Button
A pressable, animated button. Built on Radix Slot (for asChild polymorphism) and Motion (for the press-down animation that swaps to opacity under reduced motion).
Variants
Sizes
Loading state
As a link (asChild)
Use asChild to render the Button as its child element while keeping all of the styles. Combine with next/link for client-side navigation:
Accessibility notes
- Renders as a real
<button>by default — keyboard activation viaEnterandSpaceworks out of the box. - Sets
aria-busywhenloadingis true, and the loading spinner hasrole=“status”. - Focus is shown via
:focus-visibleonly — no permanent ring on mouse click. - The press animation translates 2px diagonally for users who allow motion, and drops to a subtle opacity change for users with
prefers-reduced-motion: reduce.