Ghost Button
FreeA lower-emphasis outline button for secondary actions.
npx shadcn@latest add @ui-shrushank/ghost-buttonThe install writes a single file to components/ui/GhostButton.tsx, which exports GhostButton.
tsx
import { GhostButton } from "@/components/ui/GhostButton";tsx
<GhostButton>Label</GhostButton>The secondary-action partner to Primary Button, so emphasis hierarchy is a component choice, not a className hunt.
Outline / low-fill treatment, same size and focus system as Primary.
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.
Two clearly-ranked buttons stop teams from putting two solid buttons side by side, which destroys the visual hierarchy of a form.
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.
GhostButton.tsx
TypeScript