Function
Built on the radix-ui unified package already used by Button and
Dialog, so the whole tree ships without a per-primitive dependency. Radix
supplies the behaviour this project must not re-implement: roving focus
across items, type-ahead, dismissal on Escape or an outside click, and
focus restored to the trigger on close.
This primitive is deliberately scoped to single-choice menus — the shape "@/components/locale-switcher/locale-switcher" needs — and plain navigation items for the header's learner menu. Sub-menus, checkbox items, group labels, separators, and shortcut slots are not ported; shipping the full shadcn registry surface for one consumer would be speculative generality. Add a part when a caller actually needs it.
<DropdownMenu>
<DropdownMenuTrigger aria-label="Language: English">EN</DropdownMenuTrigger>
<DropdownMenuContent>
<DropdownMenuRadioGroup value={locale} onValueChange={setLocale}>
<DropdownMenuRadioItem value="en">English</DropdownMenuRadioItem>
</DropdownMenuRadioGroup>
</DropdownMenuContent>
</DropdownMenu>
shadcn/ui
DropdownMenuroot — the state machine behind a menu.Controls whether the menu is open, either uncontrolled (via DropdownMenuTrigger) or controlled through
open/onOpenChange. Renders no DOM of its own.