Button

Used to trigger an operation.

General

The basic Button contains an animation effect.

Loading

Show running status.

Disabled

Do not respond to any action.

Shadow

The shadow highlights the level of the button.

Type Colors

You can change the color of the Button with the property type.

Lighted

Different state.

Ghost

The opposite color.

Subtle

No background until you look at the color of the text, the quietest of the four variants.

Spotlight

The spotlight prop adds a glow that follows the pointer on hover.

Rounded

You can completely round the corners of any type of Button with the rounded property.

Scale

Buttons of different sizes.

With Icons

The color and size of the icon will be set automatically.

Save with feedback

Show progress while the action runs and the result when it ends. The button is disabled after saving so it cannot run twice.

APIs

Button.Props

AttributeDescriptionTypeAccepted valuesDefault
typebutton typeButtonTypesButtonTypesdefault
ghostthe opposite colorboolean-false
subtleno background, only the type's colorboolean-false
roundedrounded buttonboolean-false
loadingdisplay loading indicatorboolean-false
shadowdisplay shadowboolean-false
autoautoscale widthboolean-false
effectdisplay animationboolean-true
spotlightglow that follows the pointer on hoverboolean-false
disableddisable buttonboolean-false
onClickclick handlerMouseEventHandler--
iconshow icon in buttonReactNode--
iconRightshow icon on the other side of the buttonReactNode--
htmlTypenative type of button elementButtonHTMLAttributes.type-button
refforwardRefRef<HTMLButtonElement | null>--
...native propsButtonHTMLAttributes'id', 'className', ...-

ButtonTypes

type ButtonTypes =
  | 'default'
  | 'primary'
  | 'secondary'
  | 'success'
  | 'warning'
  | 'error'
  | 'info'
  | 'abort'
  | 'primary-light'
  | 'secondary-light'
  | 'success-light'
  | 'warning-light'
  | 'error-light'
  | 'info-light'
Edit this page on GitHub