Skip to content

Button ​

Commonly used button.

Basic usage ​

Use type, plain, round and circle to define Button's 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 ​

Buttons without border and background.

Icon Button ​

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

Use the icon attribute to add icon. You can find the icon list in Element Plus icon component. Adding icons to the right side of the text is achievable with an <i> tag. Custom icons can be used as well.

Button Group ​

Displayed as a button group, can be used to group a series of similar operations.

Use tag <el-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.

You can use the loading slot to customize your loading component

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 large, small.

Custom Color ​

You can custom button color.

We will calculate hover color & active color automatically.

Button API ​

Button Attributes ​

NameDescriptionTypeDefault
sizebutton size^[enum]'large' | 'default' | 'small'—
typebutton type, when setting color, the latter prevails^[enum]'default' | 'primary' | 'success' | 'warning' | 'danger' | 'info' | '' | 'text' (deprecated)—
plaindetermine whether it's a plain button^[boolean]false
bgdetermine whether the text button background color is always on^[boolean]false
linkdetermine whether it's a link button^[boolean]false
rounddetermine whether it's a round button^[boolean]false
circledetermine whether it's a circle button^[boolean]false
loadingdetermine whether it's loading^[boolean]false
loading-iconcustomize loading icon component^[string] / ^[Component]Loading
disableddisable the button^[boolean]false
iconicon component^[string] / ^[Component]—
autofocussame as native button's autofocus^[boolean]false
native-typesame as native button's type^[enum]'button' | 'submit' | 'reset'button
auto-insert-spaceautomatically insert a space between two chinese characters(this will only take effect when the text length is 2 and all characters are in Chinese.)^[boolean]false
colorcustom button color, automatically calculate hover and active color^[string]—
darkdark mode, which automatically converts color to dark mode colors^[boolean]false

Button Slots ​

NameDescription
defaultcustomize default content
loadingcustomize loading component
iconcustomize icon component

ButtonGroup API ​

ButtonGroup Attributes ​

NameDescriptionTypeDefault
sizecontrol the size of buttons in this button-group^[enum]'large' | 'default' | 'small'—
typecontrol the type of buttons in this button-group^[enum]'primary' | 'success' | 'warning' | 'danger' | 'info'—

ButtonGroup Slots ​

NameDescriptionSubtags
defaultcustomize button group contentButton

Released under the MIT License.