Button

A button allows a user to perform an action, with mouse, touch, and keyboard interactions.

Examples

Disabled

Icon button

Intent: Error

Intent: Success

Intent: Warning

Slot (left)

Slot (right)

Props

intent
Intent
isDestructive
boolean
isIcon
boolean
slotLeft
SlotNode
slotRight
SlotNode
variant
"primary" | "secondary" | "tertiary"
form
string
formAction
string
formEncType
string
formMethod
string
formNoValidate
boolean
formTarget
string
name
string
value
string
isPending
boolean
id
string
type
"button" | "submit" | "reset"'button'
onFocus
((e: FocusEvent<Element, Element>) => void)
onBlur
((e: FocusEvent<Element, Element>) => void)
onKeyDown
((e: KeyboardEvent) => void)
onKeyUp
((e: KeyboardEvent) => void)
onClick
((e: MouseEvent<FocusableElement, MouseEvent>) => void)
isDisabled
boolean
onPress
((e: PressEvent) => void)
onPressStart
((e: PressEvent) => void)
onPressEnd
((e: PressEvent) => void)
onPressChange
((isPressed: boolean) => void)
onPressUp
((e: PressEvent) => void)
autoFocus
boolean
onFocusChange
((isFocused: boolean) => void)
preventFocusOnPress
boolean
excludeFromTabOrder
boolean
onHoverStart
((e: HoverEvent) => void)
onHoverEnd
((e: HoverEvent) => void)
onHoverChange
((isHovering: boolean) => void)
slot
string | null
children
ReactNode | ((values: ButtonRenderProps & { defaultChildren: ReactNode; }) => ReactNode)
className
string | ((values: ButtonRenderProps & { defaultClassName: string; }) => string)
style
CSSProperties | ((values: ButtonRenderProps & { defaultStyle: CSSProperties; }) => CSSProperties)
ref
ForwardedRef<HTMLButtonElement>