Button

Displays a clickable button element.

PropTypeDefault
color"gray" | "purple" | "red""gray"
ghostbooleanfalse
loadingbooleanfalse
size"1" | "2" | "3" | "4""2"

This component is based on the button element and supports common margin props m, mx, my, ml, mr, mt, mb. View source

Use the color prop to control the color of the button.

Use the ghost prop to create a deemphasized button.

Use the size prop to control the size of the button.

The state prop is deprecated, as the types of state it represents may not be mutually exclusive. Use disabled or loading instead.

Use the loading prop to indicate that the button is in a loading state. When loading is true the button is disabled by default.

When button changes to a loading state, screen readers announce “Loading, please wait.”

Loading and disabled buttons are focusable for accessibility reasons, but can’t be clicked and don’t submit forms.

You may nest icons directly inside the buttons. The correct gap between the icon and the text is provided automatically.