shadcn.io is not affiliated with official shadcn/ui
Dropdown Menu examples · Standard
Dropdown with Checkboxes Dropdown Menu for React
A View menu of checkbox rows that show or hide the status bar, activity bar and panel.
View toggles buried in a settings page are toggles nobody finds. This dropdown menu opens from a View button and lists Status Bar, Activity Bar and Panel as checkbox rows under an Appearance label, each with its own on or off state. It fits editors, IDE-style apps and dashboards with panels to hide.
Preview
Installation
FAQ
Which rows start checked?
Status Bar starts checked; Activity Bar and Panel start off. Each row toggles on its own.
Each DropdownMenuCheckboxItem takes checked and onCheckedChange, which receives a boolean.
Does the View button show which bars are on?
No. It always reads View, after a sliders icon. The checks inside the menu are the only place the state shows.
What wraps the label and the rows?
One DropdownMenuGroup holds the Appearance DropdownMenuLabel, a separator and the three rows, so the label names the group for screen readers.
Related
- View Options Dropdown MenuA view options menu with one layout to
- Dropdown with Radio Items Dropdown MenuA panel position picker where exactly one
- Mixed Features Dropdown Dropdown MenuA File menu that mixes actions with
- Menubar with CheckboxesA View menu of checkbox rows that show or
- Context Menu with CheckboxesA context menu of view options that
- Dropdown with Groups and Labels Dropdown MenuA menu split into labeled My Account and