Skip to content

Button

A button is a command component to trigger an operation.

Basic usage

Use type, plain, round and circle to define Buttons style.

Disabled Button

The disabled attribute determines if the button is disabled. Use disabled attribute to determine whether a button is disabled. It accepts a Boolean value.

Text Button

Button without border and background color.

Icon Button

Use icons to add more meaning to Button. You can use icon alone to save some space, or use it with text.

Button Group

Displayed as a button group, can be used to group a series of similar operations. Use tag <tu-button-group> to group your buttons.

Loading Button

Click the button to load data, then the button displays a loading state. Set loading attribute to true to display loading state.

Long Button

By setting the long property, the width of the button follows the width of the container.

Sizes

Besides default size, Button component provides three additional sizes for you to choose among different scenarios. Use attribute size to set additional sizes with mini, small, large.

Button API

Button Attributes

NameDescriptionTypeDefault
sizeButton sizeStringmedium
typeButton typeString-
roundDetermine whether it's a round buttonBooleanfalse
circleDetermine whether it's a circle buttonBooleanfalse
longWhether the width of the button adapts to the container.Booleanfalse
loadingDetermine whether it's loadingBooleanfalse
loading-iconCustomize loading icon componentString ComponentLoading
disabledDisable the buttonBooleanfalse
iconIcon componentString Component-
autofocusSame as native button's autofocusBooleanfalse
native-typeSame as native button's typeStringbutton

Button Slots

NameDescription
defaultCustomize default content
loadingCustomize loading component
iconCustomize icon component

Button Exposes

NameDescriptionType
refButton html elementObject
sizeButton sizeObject
typeButton typeObject
disabledButton disabledObject

ButtonGroup API

ButtonGroup Attributes

NameDescriptionTypeDefault
sizeControl the size of buttons in this button-groupString-
typeControl the type of buttons in this button-groupString-

ButtonGroup Slots

NameDescriptionDefault
defaultCustomize button group contentButton