Application menu
The shadcn demo on a strip of paper: File with a sub-menu and keycaps, Edit, View with ticked rows, Profiles with a radio group. Hover another title while one is open and the menu follows.
A desktop-style menu bar: a strip of paper with a pencil ruler along its foot and the menu titles written on it. Hovered, focused or open, a title wears the highlighter; each menu opens the same slip as the dropdown. Roving focus, hover-to-switch and typeahead are Radix's.
npx shadcn@latest add @wobko/menubarFirst time here? Add the registry to components.json first. How to install
The shadcn demo on a strip of paper: File with a sub-menu and keycaps, Edit, View with ticked rows, Profiles with a radio group. Hover another title while one is open and the menu follows.
Controlled rows change the page under the bar: bold and italic are ticked rows, the paper is a radio group. Every state lives in your component; the menus just report it.
A real use: the bar sits in an app header beside the title and an account button. Choosing a row reports what happened, and the bar stays one tab stop for keyboard users.
shadcn's `menubar-demo`, line for line: File, Edit, View and Profiles, with shortcuts, sub-menus, two ticked rows, an inset column and a radio group. Its checkboxes and radio are fixed (`checked`, `value="benoit"` with no handler), so they show the states without changing; the first example lets them change.
The bar (Radix Menubar root, role=menubar) and the ink host of the strip: a pale paper-shade body under a fine felt outline, a pencil ruler's ticks along the foot. Hairline and without the ruler in calm density.
| Prop | Type | Default | Description |
|---|---|---|---|
| value / defaultValue / onValueChange | string / string / (value: string) => void | - | Which menu is open (a `MenubarMenu` `value`). |
| dir | "ltr" | "rtl" | - | Reading direction; the arrows and the drawings follow it. |
| loop | boolean | true | Arrow keys wrap around the ends of the bar. |
| seed | string | number | - | Pins the hand. Default: derived from useId(). |
The slip: a Paper that is also the Radix content (role=menu). Rows scroll in a viewport inside it so the shadow is 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.
| Prop | Type | Default | Description |
|---|---|---|---|
| align | "start" | "center" | "end" | "start" | Where the slip sits under its title. |
| alignOffset | number | -4 | Nudges the slip so its text lines up with the title. |
| sideOffset | number | 8 | Gap between the bar and the slip. |
| stock | StockName | "slip" | What it is made of: slip, paper, kraft, sticky-* ... |
| 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. |
A heading in the typewriter.
| Prop | Type | Default | Description |
|---|---|---|---|
| inset | boolean | false | Lines the text up with rows that carry a tick or an icon. |
A row; the highlighter is a CSS background.
| 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 hatches in red pencil when highlighted. |
A pencil box at the start of the row, ticked in blue felt when `checked`.
| Prop | Type | Default | Description |
|---|---|---|---|
| checked | boolean | 'indeterminate' | - | Controlled state. |
| onCheckedChange | (checked: boolean) => void | - | Called when 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