Button

Commonly used button

Basic usage

Use primary, secondary, ghost and rounded to define button's style

Button Icon

Use icons to add more meaning to Button. You can use icon alone to save some space, or use it with text. You can use BigIn Icon or any iconset from iconify via unocss preset

Button States

Button can be disabled or loading for blocking any actions

Button Sizes

Besides default size, Button component provides two additional sizes for you to choose among different scenarios.

Button Group

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

Button Attributes

AttributeDescriptionTypeAccepted ValuesDefault
primarydetermine whether it's a primary buttonboolean—false
secondarydetermine whether it's a secondary buttonboolean—false
ghostdetermine whether it's a ghost buttonboolean—false
roundeddetermine whether it's a rounded buttonboolean—false
largedetermine whether it's a large buttonboolean—false
smalldetermine whether it's a small buttonboolean—false
xlargedetermine whether it's a xlarge icon buttonboolean—false
xsmalldetermine whether it's a xsmall icon buttonboolean—false
xxsmalldetermine whether it's a xxsmall icon buttonboolean—false
loadingdetermine whether it's loadingboolean—false
loading-iconcustomize loading icon componentstring / Component—Loading
disableddisable the buttonboolean—false
iconicon componentstring / Component——
prefix-iconprefix icon componentstring / Component——
suffix-iconsuffix icon componentstring / Component——
autofocussame as native button's autofocusboolean—false
native-typesame as native button's typestringbutton / submit / resetbutton

Button Slots

NameDescription
—customize default content
loadingcustomize loading component
iconcustomize icon component
prefixIconcustomize icon component
suffixIconcustomize icon component

Button-Group Attributes

AttributeDescriptionTypeAccepted ValuesDefault
roundedrounded styleboolean—false
compactno extra horizontal spacingsboolean—false
sizecontrol the size of buttons in this button-groupstringsame as button's size—
typecontrol the type of buttons in this button-groupstringsame as button's type—

Button-Group Slots

NameDescriptionSubtags
-customize button group contentButton
Last Updated:
Contributors: Tam Mai