# Button
A versatile Button component for triggering actions and events.
```jsx featured
```
```css preview
.button[data-variant] {
--button-color: var(--color, var(--primary));
height: fit-content;
font-size: medium;
border-radius: var(--lcs-radius, 1);
padding: calc(4px * var(--lcs-spacing, 1)) calc(8px * var(--lcs-spacing, 1));
gap: calc(8px * var(--lcs-spacing, 1));
cursor: pointer;
&[data-variant="solid"] {
border: 1px solid rgba(var(--button-color), 0.8);
background-color: rgba(var(--button-color), 0.9);
}
}
```
[View Source](https://github.com/LocusInc/locus-ui/tree/main/packages/locus-ui/src/components/button)
## Anatomy
```jsx code no-header
```
## Examples
### Variants
Button components come with four built in variants, `solid`, `outlined`, `muted`, and `clear`.
```jsx
{["solid", "outlined", "muted", "clear"].map((variant) => (
))}
```
### Colors
The button component uses the `color` prop to allow for predefined and custom colors.
```jsx
{[
"primary",
"secondary",
"tertiary",
"success",
"danger",
"warning",
"info",
].map((color) => (
))}
```
### Sizes
To manage the size of the button component you can provide a default or custom size through the `size` prop.
```jsx
{["xs", "sm", "md", "lg", "xl"].map((size) => (
))}
```
### States
Buttons can be given the `disabled` and `readonly` states.
```jsx
```
Each variant has its own disabled styling.
```jsx
{["solid", "outlined", "muted", "clear"].map((variant) => (
))}
```
### High Contrast
The `highContrast` prop enables high contrast mode for better visibility. High contrast button styles are only available with the `solid` variant.
```jsx
```