Icon Button

Displays a ghost button used with an icon.

PropTypeDefault
color"gray" | "purple" | "green" | "red""gray"
size"1" | "2" | "3""2"

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

Make sure to use a tooltip to provide an accessible label to the button.

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

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

A button can represent different types of state that may or may not be mutually exclusive. Most of these can be represented by props inherited from the button element, such as disabled and readOnly.

Use the loading prop to indicate that the button is in a loading state. When loading is true, the button is disabled whether or not the disabled prop is set.

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.