shadcn.io is not affiliated with official shadcn/ui
Button examples · Standard
Button with Text (Standard) for React
The filled button, for the one action you want people to take, when a page should have a single obvious next step.
Solid background, text that contrasts with it. You get this when you do not pass a variant.
Use it for Save, Send, or Continue, and keep one of those per section. If the control should stay pressed, a Toggle fits better. In React, Base UI renders a real button, and the default type does not submit the form.
Preview
Installation
FAQ
What does this Button look like?
variant is left off, so it uses default: the primary fill and primary-colored text. Hover lightens the fill. This is the action you want people to find first.
How do I change the label?
The children are the label. The demo says Button so the fill is easy to see. Use Save, Send, or whatever the click actually does.
Why doesn't this Button submit my form?
type is button by default, so a click never submits by accident. Pass type="submit" on the one button that should send the form.
How do I add a quieter button beside it?
Give the other action variant="secondary" or variant="outline". One primary fill in the row is enough. A second one makes both harder to pick.
Related
- Button with Left Icon (Standard)An icon on the main action
- Button with Text (Outline)A border, no fill
- Button with Text (Secondary)Quieter than the main action
- Button with Text (Link)Underline on hover, no fill
- Button with Text (Destructive)Delete, in the danger color
- Button with Right Icon (Standard)An arrow on the main action