shadcn.io is not affiliated with official shadcn/ui
Dropdown Menu examples · Standard
Dropdown with Radio Items Dropdown Menu for React
A panel position picker where exactly one of Top, Bottom, Right or Left is checked.
Several options, only one active at a time: that's a radio group. This dropdown menu opens from a Position button and lists Top, Bottom, Right and Left as radio items under a Panel Position label, with Bottom checked to start. It fits layout settings, sort orders and any single choice in a menu.
Preview
Installation
FAQ
How does the panel position stay selected?
The chosen position is one value, bottom to start, kept in the component. Picking a row stores its value and moves the check.
DropdownMenuRadioGroup takes value, and onValueChange receives the new value.
What is Panel Position?
The DropdownMenuLabel at the top of the radio group, followed by a separator. It names the group and can't be picked.
What does the trigger look like?
An outline Button that reads Position, with a chevron after it. The menu is w-56.
Can Top and Bottom both be selected?
No. The group holds one value, so picking Top unchecks Bottom. Use checkbox rows for options that can be on together.
Related
- Dropdown with Checkboxes Dropdown MenuA View menu of checkbox rows that show or
- Mixed Features Dropdown Dropdown MenuA File menu that mixes actions with
- Theme Selector Dropdown MenuA theme picker behind a palette button
- Basic TabsFour horizontal tabs that switch between
- Context Menu with Radio ItemsA context menu that picks one Panel
- Dropdown with Groups and Labels Dropdown MenuA menu split into labeled My Account and