Tonic UI
Getting StartedColor ModeColor StyleVersionsContributing
THEME
BordersBreakpointsColorsOutlinesPositionsSpacingSizesShadowsTypography
BUILDING BLOCKS
BoxControlBox
UTILITIES

Button

Button is used to trigger an action or event, such as submitting a form, opening a Modal, canceling an action, or performing a delete operation.

Import

Usage

EDITABLE EXAMPLE

Variants

Use the variant prop to change the visual style of Button. You can set the value to emphasis, primary, default, secondary, or ghost.

EDITABLE EXAMPLE

Sizes

Use the size prop to change the size of the button. You can set the value to sm, md, or lg.

EDITABLE EXAMPLE

States

EDITABLE EXAMPLE

Button with icon

Icon buttons are commonly used in toolbars. If required, you can add a label to icon buttons. To add padding space (.25rem (4px)) between an icon and label, use Space.

EDITABLE EXAMPLE

Custom Button

To create a custom button, you can use the style props for the ButtonBase component.

Props

NameTypeDefaultDescription
disabledbooleanIf true, the button will be disabled. This sets aria-disabled=true. You can style this state by using the _disabled prop.
sizestring'md'The size of the button. Acceptable values: 'sm', 'md', 'lg'
variantstring'default'The variant of the button style to use. Acceptable values: 'emphasis', 'primary', 'default', 'secondary', 'ghost'