npx shadcn@4.23.1 add https://registry.goop.so/g/<link>/trail-sidebar-menu-button.json --yesSidebar menu button
ProOne row of the sidebar, its icon and words, that opens a page or runs an action and shows which page is current, for React and Tailwind CSS. Part of Goop Pro.
import { SidebarMenuButton, SidebarMenuBadge } from '@/components/ui/goop/sidebar-menu-button';
import { SidebarMenu, SidebarMenuItem } from '@/components/ui/goop/sidebar-group';
<SidebarMenu>
<SidebarMenuItem>
<SidebarMenuButton icon="plus" onClick={openCreate}>
New issue
</SidebarMenuButton>
</SidebarMenuItem>
<SidebarMenuItem>
<SidebarMenuButton asChild icon="inbox" isActive>
<RouterLink href="/inbox">Inbox</RouterLink>
</SidebarMenuButton>
</SidebarMenuItem>
</SidebarMenu>Press a row to make it the active one; switch the size, the icons, the count and long words. The rows go nowhere: a press only moves the active row.
When to use
- One row of the sidebar, its icon and words, that opens a page or runs an action and shows which page is current.
Installation
Paste the prompt below into your coding agent. It reads Goop's install steps, installs the part and its tokens once, then reuses this same Sidebar menu button on every screen instead of drawing a new one: the same height, the same focus ring, the same spacing. As a Pro part, its command comes from Goop's server once you sign in, with a one-time link that lasts ten minutes.
npx shadcn@4.23.1 add https://registry.goop.so/g/<link>/trail-sidebar-menu-button.json --yesAdd the Goop Sidebar menu button to this project. The install steps are at https://goop.so/docs/install.mdUsage
import { SidebarMenuButton, SidebarMenuBadge } from '@/components/ui/goop/sidebar-menu-button';
import { SidebarMenu, SidebarMenuItem } from '@/components/ui/goop/sidebar-group';
<SidebarMenu>
<SidebarMenuItem>
<SidebarMenuButton icon="plus" onClick={openCreate}>
New issue
</SidebarMenuButton>
</SidebarMenuItem>
<SidebarMenuItem>
<SidebarMenuButton asChild icon="inbox" isActive>
<RouterLink href="/inbox">Inbox</RouterLink>
</SidebarMenuButton>
</SidebarMenuItem>
</SidebarMenu>- Fits: chat, frame, inbox (their recipes).
- height, width, padding, corner, text: add no class for these.
API reference
| Option | Type | What it does |
|---|---|---|
| size? | 'sm' | 'md' = 'md' | md the settings sidebar's row, sm the main sidebar's: the Link's two nav sizes. |
| onClick? | MouseEventHandler<HTMLAnchorElement | HTMLButtonElement> | The row's press: on a link row as on any link; with no href (and no asChild) the row is a button that fires it. |
| icon? | IconName | The glyph before the words, by the pack's name; left out, the row draws no glyph. |
| isActive? | boolean = false | The current page: the row keeps the deeper fill and the dark words. |
| asChild? | boolean = false | |
| href? | string |
- Takes every prop of Link but variant and mark (its page: link.md)
| Part | What it is |
|---|---|
| SidebarMenuBadge | A row's trailing count (<SidebarMenuBadge>3</SidebarMenuBadge>, the row's last child) |
- data-slot values (to select a part by): sidebar-menu-badge, sidebar-menu-button, sidebar-menu-button-arrow, sidebar-menu-button-icon, sidebar-menu-button-label
Keyboard
| Key | What it does |
|---|---|
| Enter | Follow |
Accessibility
- The native element answers the keyboard.
- hover, active, focus-visible: the browser's own (:hover, :active, :focus-visible): write nothing
Its states are drawn from attributes and props, so assistive technology and your agent read the same thing:
| State | Drawn by |
|---|---|
| current | the attribute aria-current=page |
Notes for AI
Give your coding agent this page as text instead of screenshots: the parts, the options, the states and the keys. An agent that reads the real part builds the real part, not a lookalike.