Account menu
The shadcn demo on a slip: a typewriter label, rows with drawn icons and keycaps, a disabled row, a sub-menu, and a destructive row last.
A menu written on a slip of paper that drops from a button. The row under the pointer or the keyboard wears the highlighter, a ticked row is a pencil box with a felt-tip tick over it, shortcuts are drawn keycaps, and a destructive row hatches in red pencil instead. Sub-menus, typeahead and focus handling are Radix's.
npx shadcn@latest add @wobko/dropdown-menuFirst time here? Add the registry to components.json first. How to install
The shadcn demo on a slip: a typewriter label, rows with drawn icons and keycaps, a disabled row, a sub-menu, and a destructive row last.
Checkbox rows are a pencil box with a felt tick written over it; radio rows are a ring with a bold dot. Both are controlled here, and the rows keep the menu open so you can tick several.
The slip is a Paper, so it can be cut from any stock and held down with tape. A sticky note with a taped corner for quick actions; the destructive row hatches when you reach it.
A real use: a list of notebooks, each row with an ellipsis button that opens its own menu. Choosing Rename or Move to trash changes the list, so you can see the handlers run.
shadcn's `dropdown-menu-checkboxes`: three controlled rows, the middle one disabled. The state is a boolean (or "indeterminate") that you own; the menu stays open while you tick.
shadcn's `dropdown-menu-radio-group`: one value for the whole group, `value` and `onValueChange` as in Radix. The chosen row carries the drawn dot.
shadcn's `dropdown-menu-dialog`: the dialogs live beside the menu, not inside it, and `onSelect` flips their open state. `modal={false}` on the menu keeps the page interactive while it closes, so focus lands in the dialog.
The slip: a Paper that is also the Radix content (role=menu). A CSS sheet with no SVG unless a torn edge is asked for. Rows scroll in a viewport inside it, never the slip, so its shadow and tape are not cut. `max-h-*`, `overflow-*` and `overscroll-*` in `className` are applied to that viewport (shadcn code writes them on the content), the rest stays on the slip. Every Radix Content prop passes through (`side`, `align`, `sideOffset`, `collisionPadding`...).
| Prop | Type | Default | Description |
|---|---|---|---|
| sideOffset | number | 6 | Gap between the trigger and the slip (upstream's is 4). |
| stock | StockName | "slip" | What it is made of: slip, paper, kraft, sticky-*, index-card ... |
| edge | EdgeSpec | "cut" | Cut (pure CSS), torn, deckle ... |
| tilt | boolean | number | true | Small seeded tilt of the sheet; text stays upright. |
| tape | "corner" | "top" | "both" | false | false | Strips of masking tape holding the slip down. |
| seed | string | number | - | Pins the hand. |
A heading in the typewriter, like the kicker of a form.
| Prop | Type | Default | Description |
|---|---|---|---|
| inset | boolean | false | Lines the text up with rows that carry a tick or an icon. |
A row. It is not an ink host: the highlighter is a CSS background, so a plain row costs one element. (A ticked row carries two small icons, about 4 KB of markup: for a list of hundreds to choose from, reach for Command or Combobox.)
| Prop | Type | Default | Description |
|---|---|---|---|
| inset | boolean | false | Lines the text up with rows that carry a tick or an icon. |
| variant | "default" | "destructive" | "default" | Destructive is red, and its highlight is a red pencil hatch (a pattern, not only a hue). |
| onSelect | (event: Event) => void | - | Runs when it is chosen; call `event.preventDefault()` to keep the menu open. |
| disabled | boolean | false | Pencil-gray, skipped by the arrow keys, cannot be chosen. |
A toggle row: a pencil box at the start, ticked in blue felt (written on) when `checked`.
| Prop | Type | Default | Description |
|---|---|---|---|
| checked | boolean | 'indeterminate' | - | Controlled state. |
| onCheckedChange | (checked: boolean) => void | - | Called when it is toggled. |
One choice: a pencil ring with a bold felt dot in the chosen one.
| Prop | Type | Default | Description |
|---|---|---|---|
| value | string | - | The value this row stands for. |
The row that opens it, with a hand-drawn chevron. It keeps the highlighter while its sub-menu is open.
| Prop | Type | Default | Description |
|---|---|---|---|
| inset | boolean | false | Lines the text up with rows that carry a tick or an icon. |
The files the CLI copies into your project.
Loading the source