Actions
Button
Variants, sizes, pill shape, icons, loading and tactile press feedback.
npx shadcn-svelte@latest add http://localhost:5173/r/button.json Variants
One accent action per view; tinted and secondary for the rest; ghost for toolbars.
light
dark
States
Rows are pinned with data-force so each state is visible at rest. Press scales to 0.97 over 160ms ease-out; colours change on plain ease. Focus is the accent ring.
light
Rest
Hover
Pressed
Focus
Disabled
Loading
dark
Rest
Hover
Pressed
Focus
Disabled
Loading
Sizes
xs 28 · sm 32 · default 40 · lg 48. Below 40px, an invisible hit area keeps touch targets at 40px.
light
Text
Icon
Pill
dark
Text
Icon
Pill
With icons and keys
light
dark
Loading
The label fades out under a spinner, so the width never changes. The button stays focusable (aria-busy) and ignores activation.
light
dark
As a link
With href it renders an anchor; disabled links lose their href and leave the tab order.