Overlays

Dropdown Menu

Floating menu attached to a button trigger.

Preview
01 Installation

Install

Pull Dropdown Menu from the barrel for everyday use, or the granular path when you want a tighter bundle.

tsxBarrel1 line
import { DropdownMenu } from "@brika/clay";
tsxGranular1 line
import { DropdownMenu } from "@brika/clay/components/dropdown-menu";
02 Usage

A minimal example

Drop this into a page. Native HTML attributes pass through to the underlying primitive.

tsxDropdown Menu.tsx42 lines
'use client';

import { LogOut, Settings, User } from 'lucide-react';
import { Button } from '@brika/clay/components/button';
import {
  DropdownMenu,
  DropdownMenuContent,
  DropdownMenuGroup,
  DropdownMenuItem,
  DropdownMenuLabel,
  DropdownMenuSeparator,
  DropdownMenuTrigger,
} from '@brika/clay/components/dropdown-menu';
/** Action menu with icons, grouped items, a separator, and a destructive item. */
export default function DropdownMenuDefaultDemo() {
  return (
    <DropdownMenu>
      <DropdownMenuTrigger asChild>
        <Button variant="outline">Account</Button>
      </DropdownMenuTrigger>
      <DropdownMenuContent className="w-48">
        <DropdownMenuLabel>My account</DropdownMenuLabel>
        <DropdownMenuSeparator />
        <DropdownMenuGroup>
          <DropdownMenuItem>
            <User />
            Profile
          </DropdownMenuItem>
          <DropdownMenuItem>
            <Settings />
            Settings
          </DropdownMenuItem>
        </DropdownMenuGroup>
        <DropdownMenuSeparator />
        <DropdownMenuItem variant="destructive">
          <LogOut />
          Log out
        </DropdownMenuItem>
      </DropdownMenuContent>
    </DropdownMenu>
  );
}
03 Examples

Dropdown Menu, every way

Checkbox

DropdownMenuCheckboxItem toggles boolean view preferences and persists checked state.

Radio

DropdownMenuRadioGroup enforces a single active selection across a set of items.

Shortcuts

DropdownMenuShortcut renders right-aligned keyboard hints, purely visual, not functional.

04 Accessibility

Accessibility

  • Arrow keys navigate items; Enter/Space activate; Escape closes and returns focus to the trigger.
  • Checkbox items carry aria-checked; radio items carry aria-checked within a role="group".
  • DropdownMenuShortcut renders keyboard hints, these are visual only and not announced by AT.
  • Destructive items should use variant="destructive" to make intent clear visually and in context.
05 API reference

API reference

Props specific to Dropdown Menu. Native HTML attributes pass through to the underlying primitive, see the component source on GitHub for the full type signature.

passthrough

No wrapper-specific props, all attributes pass through to the underlying primitive.

passthrough

No wrapper-specific props, all attributes pass through to the underlying primitive.

passthrough

No wrapper-specific props, all attributes pass through to the underlying primitive.

passthrough

No wrapper-specific props, all attributes pass through to the underlying primitive.

2 props
  • boolean
    Extra leading padding to align with items that have icons.
  • variantdefault 'default'
    'default' | 'destructive'
    "default" or "destructive" treatment.
1 prop
  • boolean
    Extra leading padding to align with items that have icons.
passthrough

No wrapper-specific props, all attributes pass through to the underlying primitive.

passthrough

No wrapper-specific props, all attributes pass through to the underlying primitive.

passthrough

No wrapper-specific props, all attributes pass through to the underlying primitive.

passthrough

No wrapper-specific props, all attributes pass through to the underlying primitive.

passthrough

No wrapper-specific props, all attributes pass through to the underlying primitive.

passthrough

No wrapper-specific props, all attributes pass through to the underlying primitive.

passthrough

No wrapper-specific props, all attributes pass through to the underlying primitive.

1 prop
  • boolean
    Extra leading padding to align with items that have icons.
passthrough

No wrapper-specific props, all attributes pass through to the underlying primitive.