shadcn.io is not affiliated with official shadcn/ui
Button Group examples · Standard
Button Group Variants for React
Two outline button groups of editing actions, Copy, Paste and Cut, then Undo and Redo.
Two short rows of editing actions, each its own ButtonGroup. Every button keeps the outline variant, which is what lets the shared border between them line up. Switch the variant for the whole group when you want a filled or quieter look.
Preview
Installation
FAQ
Which variants does this demo render?
Both groups set variant to outline on every button. The first group is Copy, Paste and Cut, and the second is Undo and Redo.
What size are these buttons?
They omit size, so they use the button's default height. Set size on each Button when you want sm or lg, and use the same value on every button in that group.
Do Copy and Paste run an action?
No. The buttons have no click handler. Put the action on the Button you want to run.
Why are Undo and Redo in a second group?
They are a separate ButtonGroup under the first, in a column with gap-4. Each group keeps its own shared border and its own aria-label, Clipboard and History.
Related
- Basic Button GroupThree rows of outline buttons joined into
- Vertical Button GroupTwo vertical button groups that stack
- Nested Button GroupsButton groups nested inside a parent
- Button with Text (Outline)A border, no fill
- Button with Text (Secondary)Quieter than the main action
- Default Toggle GroupA toggle group for bold, italic and