Button
A drop-in replacement for shadcn's Button. Same props and variant names, so existing code keeps working, with a new elevated variant, a pressed shape morph and a loading state.
Install
Install the theme once per project, then the component.
npx shadcn@latest add https://<your-registry>/r/theme.jsonnpx shadcn@latest add https://<your-registry>/r/button.jsonVariants
Ordered by emphasis. Use one default button per view for the main action. Secondary is the neutral tonal button, for everything that supports it; elevated lifts off busy backgrounds.
Sizes
Heights follow a 4px grid: 28, 32, 40, 48, 56. Default is 40, Material's standard target.
Shape
Pill is the default. Square uses the theme radius. Both tighten their corners while pressed and spring back on release. Press and hold to see it.
pill
square
With icons
Icons size to the label (1.3em, about 18px on a default button) and padding tightens on the icon side automatically.
States
Loading replaces the leading icon with a spinner, sets aria-busy and blocks clicks without changing the button's width much.
Usage
import { Button } from "@/components/ui/button"<Button variant="secondary" shape="square" loading={isSaving}> <Save /> Save draft</Button>Props
Everything else is passed to the underlying button element.
| Prop | Type | Default | Beyond shadcn |
|---|---|---|---|
| variant | "default" | "secondary" | "elevated" | "outline" | "ghost" | "destructive" | "link" | "default" | elevated |
| size | "xs" | "sm" | "default" | "lg" | "xl" | "icon-xs" | "icon-sm" | "icon" | "icon-lg" | "default" | xs, xl, icon-xs |
| shape | "pill" | "square" | "pill" | new |
| loading | boolean | false | new |
| asChild | boolean | false |