shadcn.io is not affiliated with official shadcn/ui
Dropdown Menu examples · Editor
Heading Selector Dropdown Menu for React
A heading level picker from H1 to H6, each row drawn at its own size and the button showing the current level.
A heading picker should show what each level looks like before you pick it. This dropdown menu lists Heading 1 to Heading 6 as radio items, each in bold at its own text size, and the outline button reads the current level, such as H1. It fits document editors, Markdown tools and site builders.
Preview
Installation
FAQ
How does the current heading show on the button?
The value starts at h1, and the button prints it in uppercase, H1, after a heading icon. Picking another row updates the value and the button.
DropdownMenuRadioGroup takes value, and onValueChange receives the new value.
How are the rows sized?
Each row wraps its label in a bold span: Heading 1 is text-2xl, then text-xl, text-lg, text-base and text-sm, down to text-xs for Heading 6.
Can two heading levels be selected?
No. The radio group keeps one value. Choosing Heading 3 stores h3, moves the check to that row and changes the button to H3.
Related
- Text Formatting Dropdown Dropdown MenuA text formatting menu with bold, italic
- Block Type Selector Dropdown MenuAn Insert Block menu with text, list and
- Alignment Options Dropdown MenuA text alignment picker with Left
- Dropdown with Checkboxes Dropdown MenuA View menu of checkbox rows that show or
- Button with Text (Standard)The one filled action
- Insert Options Dropdown Dropdown MenuAn insert menu behind a plus button for