Button

Button

Button component is used to handle user interactions.

Examples

Colors Pass in an object containing color tokens into colors prop. You can change color of border, background, danger color and more using primary, error, text, and so on.

Show Code

Danger Use danger prop to signal caution.

Show Code

Disabled Use disabled prop to show disabled UI of the button.

Show Code

Icon Pass in an svg icon component into icon prop. If props like stroke and fill have "currentColor" value, the svg icon will follow the text color of the button.

Show Code

Variant & Size Button components has default and primary variants. Size prop determines the paddings of the button.

Show Code
API

Button props extends the button HTML attributes.

PropertyDescriptionTypeDefault
variantThe variant of the button'primary' | 'default''default'
colorsThe color variables of the button, i.e. var(--primary){
primary?: string

error?: string

text?: string

border?: string

inputBackground?: string

primaryFocus?: string

}
undefined
dangerSignals that it should be used with caution. It is often used in a delete button or to show the error status.booleanfalse
sizeThe size of the button'sm' | 'md' | 'lg''md'
iconIcon of the button passed in as a form of ReactNodeReact.ReactNodeundefined
ellipsisWhether the button text should be truncated with an ellipsis. The button should have a width to be able to truncate the text.booleanfalse