Button Groups

Ready to use Tailwind CSS button group components with production-ready, copy-paste HTML code. Use them as they are, or as a starting point to build beautiful websites.

Button groups are useful when you have a small set of related actions and want them visually connected, like a segmented control, a toolbar, or pagination controls. We have a few variations: simple grouped buttons with shared borders, icon-only groups, mixed icon-and-text, and some with a divider between options. They're the kind of component that's a bit annoying to build from scratch but pretty quick to drop in and adapt.

Tailwind

Frequently asked questions

Grouped text buttons, icon-only groups, mixed icon and text, and some with a vertical divider between options. Horizontal layout across the board.

They work well for that kind of thing. The layouts are pure HTML and CSS so there's no switching behavior built in, you'd wire up the active state with a bit of your own JavaScript.

Yes, just add more button elements. The rounded corners are set with explicit classes though, rounded-l-lg on the first button and rounded-r-lg on the last, so you'll need to move those manually when you add or remove buttons.

One variant has a dropdown menu attached to the button. The vanilla JavaScript for opening and closing that dropdown is already included in the component snippet.

They're horizontal by design. On very small screens they might feel tight, you might want to switch to a stacked or full-width layout at that point.

Related Tailwind CSS components

More free, copy-paste Tailwind CSS components to use in your projects.