Measured entry
shadcn-button-group
A source-copied React primitive for visually joining buttons, labels, and separators in horizontal or vertical groups. It ships as Tailwind-styled component code and relies on the shadcn class-merging helper, class-variance-authority, Radix Slot, and the companion Separator primitive.



Measured
Every value below was written by the harness on the run that produced the frames above. None of it is derived from the prose.
| Build | OK |
|---|---|
| Mount | OK |
| Console errors | 0 |
| Uncaught page errors | 0 |
| Horizontal overflow | clean at 375, 768, 1440 |
| Axe critical | 0 |
| Axe serious | 0 |
| Axe moderate | 0 |
| Axe minor | 0 |
| Gzip marginal | 32.2 KB (97.7 KB build, 65.5 KB baseline) |
| Bare mode | FAIL |
| Provider required | NO |
| Demo used | written from the component source API |
What the harness recorded
BARE BUILD
✗ Build failed in 1.53s error during build: [vite]: Rollup failed to resolve import "class-variance-authority" from "<sandbox>re-ff2bc5942c29/src/cut/components/ui/button-group.tsx".
Verdict
A dependable layout primitive when the surrounding controls already own their state and semantics. It built and mounted cleanly, stayed contained across the tested layouts, and produced no automated accessibility findings, but it is not a full interaction pattern by itself.
Use it if
- You need a compact toolbar or view switcher whose adjacent controls share borders and corner treatment.
- Your React app already uses Tailwind and shadcn conventions, including the shared class-merging helper.
- You want horizontal and vertical grouping while retaining control over the actual buttons and their behavior.
Skip it if
- You need a complete segmented-control widget with selection state and keyboard behavior built in.
- Your design system avoids Tailwind utility classes or source-copied components.
- You want a dependency-free wrapper and do not already carry the Radix and variant-class utilities.
Install
| Declared dependencies | radix-ui, clsx, tailwind-merge |
|---|---|
| Missing on install | none |
| Bare install | fails once the shadcn-style helpers are removed, so it needs that setup |
| Provider | no provider required in the harness |
In a non-shadcn project, add Tailwind, class-variance-authority, Radix UI, clsx, and tailwind-merge; provide a compatible cn helper and copy or replace the Separator primitive. Also map the source import aliases to your project structure.
Source and credit
This page is a review, not a copy. The component source lives with its author and this site does not republish it. Read the license before you use anything.
Author repository
github.com/shadcn-ui/uiAlternatives
Other published entries for the button pattern, ordered by what they measured: mounts first, then clean axe scans, then bare-mode passes, then the smaller bundle.
- neu-buttonneumorphism
- Renders
- YES
- A11y
- 0
- Gzip
- 17.8KB
- Bare
- pass
- Prov
- NO
- clay-buttonclaymorphism
- Renders
- YES
- A11y
- 0
- Gzip
- 18.2KB
- Bare
- pass
- Prov
- NO
- tripled-animated-radio-shadcnuiminimal-flat
- Renders
- YES
- A11y
- 0
- Gzip
- 58.2KB
- Bare
- pass
- Prov
- NO
- ruixen-glow-link-buttonliquid-glass
- Renders
- YES
- A11y
- 0
- Gzip
- 58.9KB
- Bare
- pass
- Prov
- NO
- tripled-mood-gradient-button-shadcnuigradient-glow
- Renders
- YES
- A11y
- 0
- Gzip
- 59.2KB
- Bare
- pass
- Prov
- NO
- ruixen-glass-ai-cardliquid-glass
- Renders
- YES
- A11y
- 0
- Gzip
- 59.5KB
- Bare
- pass
- Prov
- NO