DropdownMenu
Responsive Apple Liquid Glass dropdown menu displaying a floating macOS 27 Liquid Glass menu with #0069F9 highlights on desktop, and automatically adapting to a swipe-to-dismiss iOS 27 bottom Liquid Glass Drawer with submenu drill-down on mobile.
Fully compatible with the standard shadcn/ui JSX API (<DropdownMenu> / <DropdownMenuTrigger> / <DropdownMenuContent> / <DropdownMenuGroup> / <DropdownMenuItem> / <DropdownMenuCheckboxItem> / <DropdownMenuRadioGroup> / <DropdownMenuSub>), adapting automatically via useIsMobile() (768px):
- Desktop (
>= 768px· macOS 27): Powered by@base-ui/react/menu, opening a floating14px-radius Liquid Glass menu with compact28pxrows,#0069F9hover highlight, trailing checkmarks (✓), keyboard shortcuts, and cascading submenus. - Mobile (
< 768px· iOS 27): Automatically switches to a32pxtop-radius iOS 27 bottom Liquid Glass Drawer powered by@base-ui/react/drawer, complete with swipe-to-dismiss, top grabber handle, Inset Grouped lists, trailing Apple Blue checkmarks, and in-drawer submenu navigation with‹ Back.
Responsive Live Preview
Includes group labels, shortcuts, nested submenus, disabled items, and destructive actions; toggle the Mobile icon top-right to explore the iOS 27 bottom Drawer and submenu navigation, or adjust the sidebar Glass Tint slider:
Installation (Shadcn Registry)
# Install via the configured @apple-liquid namespace (includes drawer, liquid-surface, use-mobile, and liquid-glass)
npx shadcn@latest add @apple-liquid/dropdown-menu
# Or install directly via URL
npx shadcn@latest add https://your-domain.com/r/dropdown-menu.jsonCheckbox Items
Following Apple 27 menu guidelines, checkmarks align on the right so leading icons, labels, and section headings stay vertically aligned; on mobile, the Drawer stays open by default for multi-toggle convenience:
Radio Group
Use DropdownMenuRadioGroup and DropdownMenuRadioItem for mutually exclusive selections:
Usage
import { Button } from '@/components/ui/button';
import {
DropdownMenu,
DropdownMenuContent,
DropdownMenuGroup,
DropdownMenuItem,
DropdownMenuLabel,
DropdownMenuSeparator,
DropdownMenuShortcut,
DropdownMenuTrigger,
} from '@/components/ui/dropdown-menu';
export function Example() {
return (
<DropdownMenu>
<DropdownMenuTrigger render={<Button variant="secondary">Actions</Button>} />
<DropdownMenuContent title="File Actions" className="w-56">
<DropdownMenuGroup>
<DropdownMenuLabel>File</DropdownMenuLabel>
<DropdownMenuItem>
Rename
<DropdownMenuShortcut>⌘E</DropdownMenuShortcut>
</DropdownMenuItem>
<DropdownMenuItem>
Duplicate
<DropdownMenuShortcut>⌘D</DropdownMenuShortcut>
</DropdownMenuItem>
</DropdownMenuGroup>
<DropdownMenuSeparator />
<DropdownMenuItem variant="destructive">
Move to Trash
<DropdownMenuShortcut>⌘⌫</DropdownMenuShortcut>
</DropdownMenuItem>
</DropdownMenuContent>
</DropdownMenu>
);
}Note: Base UI requires
DropdownMenuLabelto be nested inside<DropdownMenuGroup>for proper accessibility announcements on desktop and Inset Grouped section headers on mobile.
Props API
DropdownMenuContent
| Prop | Type | Default | Description |
|---|---|---|---|
glass | boolean | true | Liquid Glass material reacting to glass tint; false renders a 100% opaque surface |
title | React.ReactNode | — | Centered header title for the mobile bottom Drawer (automatically switches to submenu title with Back button) |
side | 'top' | 'bottom' | 'left' | 'right' | 'bottom' | Desktop only: popup side relative to trigger |
align | 'start' | 'center' | 'end' | 'start' | Desktop only: alignment along popup axis |
sideOffset | number | 6 | Desktop only: distance in px from trigger |
alignOffset | number | 0 | Desktop only: offset in px along alignment axis |
DropdownMenuItem
| Prop | Type | Default | Description |
|---|---|---|---|
variant | 'default' | 'destructive' | 'default' | destructive applies Apple Red destructive styling |
inset | boolean | false | Adds leading indentation to align with icon items |
closeOnClick | boolean | true | Automatically close menu / Drawer on click |
disabled | boolean | false | Disable item interaction |
DropdownMenuSubContent
| Prop | Type | Default | Description |
|---|---|---|---|
side | 'top' | 'bottom' | 'left' | 'right' | 'right' | Desktop only: submenu side (mobile uses in-Drawer view stack) |
sideOffset | number | 4 | Desktop only: distance in px from parent menu |
Language & Text
DropdownMenu accepts locale and messages, which apply to all of its parts and the overlays it opens and win over the global <LiquidGlassProvider locale messages>. To override the text globally, put it under messages.dropdownMenu on the provider. See Liquid Glass → Global settings.
| Prop | Type | Description |
|---|---|---|
locale | LiquidGlassLocaleInput | UI language of this component (any BCP 47 tag; unsupported ones fall back to English) |
messages | Partial<DropdownMenuMessages> | Text overrides, merged over the built-in text and the global messages.dropdownMenu |
| Key | Built-in text (English) |
|---|---|
back | Back |
title | Menu |
Drawer
Gesture-driven drawer built to iOS 27 edge-hugging rounded Liquid Glass guidelines, supporting four-way swipe edges, multi-step Snap Points, and isolated-layer SDF optical refraction.
Empty
Apple 27 empty state inspired by ContentUnavailableView, featuring a rounded icon tile, prominent title, secondary description, and action slot (20px mobile ↔ 15px desktop title).