Theme
Install with your agentnpx shadcn@4.23.1 add @goop/trail-menu-button

Menu button

Free

The button a menu opens from, shown as words, a workspace's tile or an icon, for React and Tailwind CSS. Free, MIT.

Open a menu button by click, Enter or the down arrow. In the workspace look switch to another workspace (the button and the page under it follow), or sign out and in again; Look also shows a view’s heading, the tools pill (turn tools on and off), the help disc and the ellipsis of more actions at two sizes. The workspaces, the sign-in and every row are our own sample: nothing is signed out of, and a picked row is only written down.

When to use

  • The button a menu opens from, shown as words, a workspace's tile or an icon.
  • Also called: dropdown button.

When not to use

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 Menu button on every screen instead of drawing a new one: the same height, the same focus ring, the same spacing.

Terminal
npx shadcn@4.23.1 add @goop/trail-menu-button
PROMPT
Add the Goop Menu button to this project. The install steps are at https://goop.so/docs/install.md

Usage

TSX
import { MenuButton, MenuButtonAvatar, MenuButtonLabel, MenuButtonIcon } from '@/components/ui/goop/menu-button';
import { DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuItem } from '@/components/ui/goop/dropdown-menu';

<DropdownMenu>
  <DropdownMenuTrigger asChild>
    <MenuButton>
      <MenuButtonLabel>Workspace</MenuButtonLabel>
    </MenuButton>
  </DropdownMenuTrigger>
  <DropdownMenuContent aria-label="Workspace">
    <DropdownMenuItem>Workspace settings</DropdownMenuItem>
    <DropdownMenuItem>Log out</DropdownMenuItem>
  </DropdownMenuContent>
</DropdownMenu>
  • Fits: list, record: toolbar.
  • height, width, padding, gap, corner, border, background, shadow, text, motion: add no class for these.

API reference

Options
OptionTypeWhat it does
shaperounded | pill | circle | icon = pill
sizesm | md | lg = md
aria-label?stringThe button's name for assistive technology: required on the help disc and the icon shape, which hold no words.
asChild?boolean = false
type?'button' | 'submit' | 'reset'
onClick?(event: MouseEvent) => void
disabled?boolean
Parts
PartWhat it is
MenuButtonAvatarThe workspace's (or a person's) tile; also takes name?: string; hue?: AvatarHue; fill?: string; status?: 'online' | 'away' | 'busy' | 'offline'; statusLabel?: string
MenuButtonLabelThe button's words where they carry their own type
MenuButtonIconAn icon before the words; className?: string — Classes added to the glyph's holder; its box and ink are already set; icon: IconName — A pack icon name
  • Class recipes (cva): menuButtonVariants (MenuButton)
  • data-slot values (to select a part by): menu-button, menu-button-icon, menu-button-indicator, menu-button-label

Keyboard

KeyWhat it does
EnterOpen the menu
ArrowDownOpen the menu

Accessibility

  • The native element answers the keyboard.
  • hover, active, focus, focus-visible: the browser's own (:hover, :active, :focus, :focus-visible): write nothing

Its states are drawn from attributes and props, so assistive technology and your agent read the same thing:

StateDrawn by
expandedthe attribute data-state=open
openthe attribute data-state=open
disabledthe prop disabled

Motion

  • The part sets its own motion: add no transition or animation of your own.
  • How the theme moves, and how to move your own parts the same way: Motion.

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.

goop.so/themes/trail/components/menu-button.md · the page as Markdown
Theme
Install with your agentnpx shadcn@4.23.1 add @goop/trail-menu-button

Where would you like to start?

Free · now

The Goop plugin

A design system for your AI coding agent, so screen ten matches screen one.

/plugin marketplace add goop-so/skillsthen /plugin install goop@goopCodex, Cursor, ChatGPT, the Claude app and more: Connect Goop
FreePro

The components

Every part live, with its props, its keys and what an agent sees. Whole page and app templates, working with sample data.