Button
Buttons allow users to take actions, and make choices, with a single tap.
Buttons communicate actions that users can take. They are typically placed throughout your UI, in places like:
- Modal windows
- Forms
- Cards
- Toolbars
Variants
The Button
comes with four global variants: solid
(default), soft
, outlined
and plain
.
<Button variant="solid">Solid</Button>
<Button variant="soft">Soft</Button>
<Button variant="outlined">Outlined</Button>
<Button variant="plain">Plain</Button>
Colors
All theme palettes are available via the color
prop which can be combined with the variant
prop.
Variant:
<Button size="sm">Small</Button>
<Button size="md">Medium</Button>
<Button size="lg">Large</Button>
<Button disabled variant="solid">
Solid
</Button>
<Button disabled variant="soft">
Soft
</Button>
<Button disabled variant="outlined">
Outlined
</Button>
<Button disabled variant="plain">
Plain
</Button>
<Button startIcon={<Add />}>Add to cart</Button>
<Button
aria-label="Like"
variant="soft"
color="neutral"
endIcon={<KeyboardArrowDown fontSize="lg" />}
>
<ThumbUp />
</Button>
<Button variant="outlined" endIcon={<KeyboardArrowRight />} color="success">
Checkout
</Button>
Icon button
If you want an equal width and height button without displaying the label, use IconButton
. It accepts the same values for variant
, color
, and size
props.
<IconButton variant="solid">
<FavoriteBorder />
</IconButton>
<IconButton variant="soft">
<FavoriteBorder />
</IconButton>
<IconButton variant="outlined">
<FavoriteBorder />
</IconButton>
<IconButton variant="plain">
<FavoriteBorder />
</IconButton>
<Button component="a" href="#as-link" startIcon={<OpenInNew />}>
Open in new tab
</Button>
<IconButton aria-label="Open in new tab" component="a" href="#as-link">
<OpenInNew />
</IconButton>
Unstyled
The component also comes with an unstyled version. It's ideal for doing heavy customizations and minimizing bundle size.