shadcn.io is not affiliated with official shadcn/ui
Button Group examples · Actions
File Operations Button Group for React
Download, Share, Edit and Delete in one button group, with labels and as a compact icon-only row.
The four things people do with a file, kept together. The labeled row suits a file detail page; the icon-only row fits a table cell or a card corner, where each button carries an aria-label instead of text.
Preview
Installation
FAQ
What is in the labeled row?
Download, Share, Edit and Delete. Each has an icon before the label, size="sm" and variant="outline". None of them have a click handler.
How is the icon-only row named?
Each Button has an aria-label with the action's name and size="icon-sm". The icons have aria-hidden="true", so only the label is read.
Is Delete styled differently?
No. It uses the same variant="outline" as the others, so the joined border stays even. Confirm the delete in a dialog rather than relying on a red button.
How do I make Download a real link?
render with an anchor and nativeButton={false} on the Button.Do the two rows share state?
No. They are two layouts of the same actions, stacked with gap-4. Nothing in the file is stateful.
Should the icon buttons have tooltips?
For people using a mouse, a Tooltip with the same words as the aria-label helps. The demo leaves them out.
Related
- Bulk Actions Button GroupA row of bulk actions, Select All
- Social Actions Button GroupLike, Comment and Share in one button
- Overflow Menu Button GroupAction button groups that keep the main
- File Operations Menu Context MenuA file context menu to open, rename
- Button with Text (Destructive)Delete, in the danger color
- Comment Actions Button GroupReply, Edit, Delete and Report as ghost