Measured entry

shadcn-button

buttonunclassified

A source-distributed React button from the shadcn registry, with visual and size variants plus an asChild composition option. It ships as TypeScript to copy into an app, not as a standalone package, and relies on Tailwind theme classes, a local cn helper, class-variance-authority, and the radix-ui Slot primitive.

Specimen
Harness screenshot of shadcn-button at 375 pixels wide
Harness screenshot at 375 pixels wide. No horizontal overflow recorded.
Harness screenshot of shadcn-button at 768 pixels wide
Harness screenshot at 768 pixels wide. No horizontal overflow recorded.
Harness screenshot of shadcn-button at 1440 pixels wide
Harness screenshot at 1440 pixels wide. No horizontal overflow recorded.

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.

Harness measurements recorded for shadcn-button
BuildOK
MountOK
Console errors0
Uncaught page errors0
Horizontal overflowclean at 375, 768, 1440
Axe critical0
Axe serious0
Axe moderate0
Axe minor0
Gzip marginal13.4 KB (78.0 KB build, 64.6 KB baseline)
Bare modeFAIL
Provider requiredNO
Demo usedwritten from the component source API

What the harness recorded

BARE BUILD

✗ Build failed in 851ms
error during build:
[vite]: Rollup failed to resolve import "class-variance-authority" from "<sandbox>/src/cut/components/ui/button.tsx".

Verdict

A solid fit inside a shadcn-based design system, with useful variants and composition support. It builds and mounts in the prepared harness, but the bare check fails on a missing class-variance-authority import, so it needs a shadcn-style setup rather than direct copying into an unprepared app.

Use it if

  • Your app already follows the shadcn component and theme conventions.
  • You want a shared button API with preset intent, size, icon, and link treatments.
  • You need asChild composition for links or other elements while preserving button styling.

Skip it if

  • You need a drop-in package that works without local source, theme tokens, or utility CSS setup.
  • Your design system already owns button variants and interaction states.
  • You want to avoid radix-ui and class-variance-authority dependencies for a basic control.

Install

Installation record for shadcn-button
Declared dependenciesradix-ui
Missing on installnone
Bare installfails once the shadcn-style helpers are removed, so it needs that setup
Providerno provider required in the harness

In a non-shadcn project, add React, radix-ui, class-variance-authority, a Tailwind setup that supports the component's utility classes and theme tokens, the local cn class-merging helper, and either the expected path alias or a corrected relative import. Include the supporting global theme styles as well.

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/ui
License
MIT
Record published
2026-08-12

Alternatives

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.