Home Components Button Group
React Button Group Components
12 free React button groups built with Tailwind CSS and shadcn/ui conventions. Copy the code or install with the shadcn CLI. Great for segmented controls, toolbars, and split buttons.
ButtonGroup 1 : Upload button joined to a static count segment that reads 24 files.ButtonGroup 2 : Save button with a counter segment, where clicking fills the bookmark icon and updates the count.ButtonGroup 3 : Toolbar of five outline icon buttons for layers, comment, style, trim and enhance, each with a tooltip.ButtonGroup 4 : Pill-shaped filled media control group with restart, play, pause and next icon buttons and tooltips.ButtonGroup 5 : Round-ended row of colour-coded icon links that tint their background in a matching colour on hover.ButtonGroup 6 : Quantity stepper with minus and plus buttons around a count limited from 0 to 5.ButtonGroup 7 : Filled width stepper that adjusts a pixel value in steps of 8 between 120 and 320.ButtonGroup 8 : Open preview link button joined to an icon button that opens the preview in a new tab.ButtonGroup 9 : Pill-shaped group of outline buttons with icons and labels for customize, clone and archive.ButtonGroup 10 : Dark rounded pair of icon buttons for rotating left and right.ButtonGroup 11 : Split button whose chevron opens a menu to choose the send action, each with a description.ButtonGroup 12 : Compact segmented bar of ghost buttons with small icons and labels inside a ringed tray.
About React Button Group Components A React button group joins related buttons into one connected control, like a split button, a segmented toolbar, or an action with a count. Watermelon UI button groups are composed from the shadcn Button with Tailwind CSS, merging borders and rounding only the outer corners. Add one with the shadcn CLI, then change the buttons, icons, and labels inside it.
When to use it Editor toolbars with bold, italic, and underline next to each other. Split buttons with a main action and a menu of related ones. Pagers or zoom controls with previous, next, plus, and minus. When to use something else Use Tabs when the segments switch between views rather than run actions. Use Radio Group when the user picks exactly one value in a form. Use Dropdown Menu when there are too many actions to show side by side. Frequently asked questions How do I group buttons together in shadcn? Wrap the buttons in an inline-flex container and remove the inner rounding so only the outer corners stay round. Overlap borders with -space-x-px so they do not double up.
How do I make a split button with a dropdown? Put a main Button next to an icon Button that is the trigger of a DropdownMenu. Join them with the same group container so they read as one control.
How do I show which button in a group is active? Keep the selected value in state and switch that button’s variant or add an active class. Add aria-pressed to toggle buttons so assistive tech knows the state.
How do I make a shadcn button group full width? Pass className="w-full" to ButtonGroup, which is w-fit by default, and add flex-1 to each Button. The group is a flex row, so the buttons then share the width evenly.
How to use React Button Group Components Start from a React project with Tailwind CSS and shadcn/ui set up. Next.js, Vite, Remix, and Astro all work. Run npx shadcn@latest add https://registry.watermelon.sh/r/button-group-1.json to add the source files to your project. Import it where you need it, then edit the Tailwind classes and design tokens to match your product. Dependencies installed with it: lucide-react.
The code is yours: it lives in your repository, so there is no runtime package to keep updated. Watermelon UI is free and open source under the MIT license.
More: Free React components , UI library alternatives , guides .