WarUI documentation

Button sizes and width

stable

Choose a size and optionally fill the available width.

Live example

Example controls

Expected behavior

Size changes the padding and text scale. Full width fills the available inline space.

Source

<war-button size="lg" full-width>Continue</war-button>

API reference

war-button manifest
KindNameTypeDescription
Propertyvariant'primary' | 'secondary' | 'tertiary' | 'danger' | 'ghost' | 'link'—
Propertysize'sm' | 'md' | 'lg'—
PropertyfullWidthboolean—
PropertyiconOnlyboolean—
Propertylabelstring—
Propertyloadingboolean—
Propertydisabledboolean—
PropertysoftDisabledboolean—
Propertyhrefstring | undefined—
Propertytargetstring | undefined—
Propertyrelstring | undefined—
Propertydownloadstring | undefined—
Propertytype'button' | 'submit' | 'reset'—
Propertynamestring—
Propertyvaluestring—
PropertyformHTMLFormElement | null—
Attributevariant'primary' | 'secondary' | 'tertiary' | 'danger' | 'ghost' | 'link'Visual emphasis.
Attributesize'sm' | 'md' | 'lg'Size of the control.
Attributefull-widthbooleanFill the available inline space.
Attributeicon-onlybooleanDisplay the default slot as an icon.
AttributelabelstringExplicit accessible name.
AttributeloadingbooleanPending state blocks activation.
AttributedisabledbooleanRemove from the tab order and block activation.
Attributesoft-disabledbooleanRemain focusable but block activation.
Attributehrefstring | undefinedRender a link instead of a button.
Attributetargetstring | undefinedLink target context.
Attributerelstring | undefinedLink relationship.
Attributedownloadstring | undefinedSuggested download name.
Attributetype'button' | 'submit' | 'reset'Native form action.
AttributeformstringID of the associated form.
AttributenamestringSubmitter name.
AttributevaluestringSubmitter value.
Eventwar-clickCustomEvent<{type:string}>Cancelable event before activation.
Slot(default)—Visible label or icon.
Slotstart—Leading content.
Slotend—Trailing content.
CSS partbase—Native control.
CSS partlabel—Label wrapper.
CSS partstart—Leading content wrapper.
CSS partend—Trailing content wrapper.
CSS partspinner—Loading indicator.
CSS property--war-button-background—Custom background.
CSS property--war-button-foreground—Custom foreground.
CSS property--war-button-border—Custom border color.