From b5b9d99a407215ba4166034d328877fa6b74b959 Mon Sep 17 00:00:00 2001 From: radiumcoders Date: Mon, 19 Oct 2026 20:58:10 +0530 Subject: [PATCH 1/2] Add a panel layout to CliCommand A borderless strip with an Install heading and the package manager picker beside it, and the command wrapping on a plate instead of scrolling, for narrow spots. Copies record which layout they came from. --- components/cli-command.tsx | 127 ++++++++++++++++++++++++------------- 1 file changed, 82 insertions(+), 45 deletions(-) diff --git a/components/cli-command.tsx b/components/cli-command.tsx index e6ffc83..5dec508 100644 --- a/components/cli-command.tsx +++ b/components/cli-command.tsx @@ -108,6 +108,12 @@ export interface CliCommandProps { bun?: string /** Initial package manager when nothing is stored yet */ defaultManager?: PackageManager + /** + * `card` (default) is the framed block for docs pages. `panel` is the + * borderless strip at the foot of the props panel, where the command + * wraps instead of scrolling. + */ + variant?: "card" | "panel" className?: string } @@ -126,6 +132,7 @@ export function CliCommand({ yarn, bun, defaultManager = "pnpm", + variant = "card", className, }: CliCommandProps) { const manager = useSyncExternalStore( @@ -134,8 +141,7 @@ export function CliCommand({ () => defaultManager ) - const resolvedCommand = - command ?? (item ? commandForItem(item, github) : "") + const resolvedCommand = command ?? (item ? commandForItem(item, github) : "") const fromCommand = resolvedCommand ? buildCommands(resolvedCommand) : null const commands: Record = { @@ -159,6 +165,78 @@ export function CliCommand({ window.dispatchEvent(new Event(MANAGER_EVENT)) } + const managerSelect = ( +
+ + + + +
+ ) + + const copyButton = ( + + trackEvent("cli_command_copied", { + package_manager: manager, + source: github ? "github" : "registry", + placement: variant, + ...(item ? { item } : {}), + }) + } + /> + ) + + if (variant === "panel") { + return ( +
+
+ + Install + + {managerSelect} +
+
+
+            {activeCommand}
+          
+ {copyButton} +
+
+ ) + } + return (
-
- - - - -
+ {managerSelect}
           {activeCommand}
         
- - trackEvent("cli_command_copied", { - package_manager: manager, - source: github ? "github" : "registry", - ...(item ? { item } : {}), - }) - } - /> + {copyButton}
) From c6a23e1bedb73b9ec4988149c022d7d819b89ec1 Mon Sep 17 00:00:00 2001 From: radiumcoders Date: Mon, 19 Oct 2026 20:58:10 +0530 Subject: [PATCH 2/2] Pin the install command to the foot of the props panel On component pages the panel now ends in the shadcn add command for that component, held at the bottom while the props scroll, so it's in reach the moment the props look right. --- app/docs/[[...slug]]/page.tsx | 2 +- components/docs-stage.tsx | 27 +++++++++++++++++++++++---- 2 files changed, 24 insertions(+), 5 deletions(-) diff --git a/app/docs/[[...slug]]/page.tsx b/app/docs/[[...slug]]/page.tsx index 2a1cde0..005e9b5 100644 --- a/app/docs/[[...slug]]/page.tsx +++ b/app/docs/[[...slug]]/page.tsx @@ -83,7 +83,7 @@ export default async function Page(props: { // The outline rides inside the sheet, beside the article. if (component) { return ( - + {/* Same gutter and radius as the stage above it. */}
(null) const [controlsSlot, setControlsSlot] = useState(null) const [hasControls, setHasControls] = useState(false) @@ -43,11 +53,20 @@ export function DocsStage({ children }: { children: ReactNode }) { />
{children}