Skip to main content

Button

Beta Public 

Buttons allow users to take actions, and make choices, with a single tap.

Remarks

Buttons communicate actions that users can take. They are typically placed throughout your UI, in places like:

  • Dialogs
  • Modal windows
  • Forms
  • Cards -Toolbars

Properties

children ✳️

The text to display in the button.

Type
ReactNode

type

The button type.

Default Value: 'button'

Type
'button' | 'submit' | 'reset'

variant

The button variant.

Since: 1.1.0

Default Value: 'default'

Type
'default' | 'primary' | 'success' | 'danger'

onClick

Button click event handler.

Type
(event: React.MouseEvent<HTMLButtonElement>) => void

Parameters

NameDescription
eventThe click event.

Returns

void

Examples

Logging the click event

onClick={() => {
console.log('Button clicked');
}}