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 buttonbooleanfalse
secondarydetermine whether it's a secondary buttonbooleanfalse
ghostdetermine whether it's a ghost buttonbooleanfalse
roundeddetermine whether it's a rounded buttonbooleanfalse
largedetermine whether it's a large buttonbooleanfalse
smalldetermine whether it's a small buttonbooleanfalse
xlargedetermine whether it's a xlarge icon buttonbooleanfalse
xsmalldetermine whether it's a xsmall icon buttonbooleanfalse
xxsmalldetermine whether it's a xxsmall icon buttonbooleanfalse
loadingdetermine whether it's loadingbooleanfalse
loading-iconcustomize loading icon componentstring / ComponentLoading
disableddisable the buttonbooleanfalse
iconicon componentstring / Component
prefix-iconprefix icon componentstring / Component
suffix-iconsuffix icon componentstring / Component
autofocussame as native button's autofocusbooleanfalse
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 stylebooleanfalse
compactno extra horizontal spacingsbooleanfalse
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