Primary Button
FreeThe default call to action, solid fill with hover and focus states.
npx shadcn@latest add @ui-shrushank/primary-buttonThe install writes a single file to components/ui/PrimaryButton.tsx, which exports PrimaryButton.
import { PrimaryButton } from "@/components/ui/PrimaryButton";<PrimaryButton>Label</PrimaryButton>Needs framer-motion installed. The shadcn CLI adds it for you.
The default call-to-action; every library needs the anchor case.
Solid fill, explicit hover and focus-visible states, one accent token.
Every line below was read out of the file you are about to copy, so you can check each one against the source at the bottom of this page.
- Has an explicit
prefers-reduced-motionbranch: the animation is dropped for an instant state change, and the component stays fully usable without it. - Draws a
focus-visiblering that is separate from its hover treatment, so keyboard users get an affordance mouse users do not take away.
Focus state is separate from hover so keyboard users get the same affordance mouse users get; a CTA with no visible focus ring is the most common a11y failure in button kits.
1 required, 0 optional.
| Prop | Type | Default |
|---|---|---|
childrenrequired | React.ReactNode | none |
childrenrequiredReact.ReactNode
One file, no runtime package. Copy it, or install it with the command at the top of this page.