WarUI documentation

Button start and end slots

stable

Give the label a leading or trailing visual cue.

Live example

Example controls

Expected behavior

The slots follow the inline direction. Decorative arrows do not change the accessible name.

Source

<war-button><span slot="start" aria-hidden="true">+</span>Continue<span slot="end" aria-hidden="true">›</span></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.