Loading button
stable
Mark the action as busy while work is in progress.
Live example
Expected behavior
The spinner appears, the label remains available to screen readers, and clicks are ignored.
Source
<war-button loading>Save changes</war-button><WarButton loading>Save changes</WarButton><war-button-angular [loading]="true">Save changes</war-button-angular><WarButton loading>Save changes</WarButton><WarButton Loading="true">Save changes</WarButton>API reference
| Kind | Name | Type | Description |
|---|---|---|---|
| Property | variant | 'primary' | 'secondary' | 'tertiary' | 'danger' | 'ghost' | 'link' | — |
| Property | size | 'sm' | 'md' | 'lg' | — |
| Property | fullWidth | boolean | — |
| Property | iconOnly | boolean | — |
| Property | label | string | — |
| Property | loading | boolean | — |
| Property | disabled | boolean | — |
| Property | softDisabled | boolean | — |
| Property | href | string | undefined | — |
| Property | target | string | undefined | — |
| Property | rel | string | undefined | — |
| Property | download | string | undefined | — |
| Property | type | 'button' | 'submit' | 'reset' | — |
| Property | name | string | — |
| Property | value | string | — |
| Property | form | HTMLFormElement | null | — |
| Attribute | variant | 'primary' | 'secondary' | 'tertiary' | 'danger' | 'ghost' | 'link' | Visual emphasis. |
| Attribute | size | 'sm' | 'md' | 'lg' | Size of the control. |
| Attribute | full-width | boolean | Fill the available inline space. |
| Attribute | icon-only | boolean | Display the default slot as an icon. |
| Attribute | label | string | Explicit accessible name. |
| Attribute | loading | boolean | Pending state blocks activation. |
| Attribute | disabled | boolean | Remove from the tab order and block activation. |
| Attribute | soft-disabled | boolean | Remain focusable but block activation. |
| Attribute | href | string | undefined | Render a link instead of a button. |
| Attribute | target | string | undefined | Link target context. |
| Attribute | rel | string | undefined | Link relationship. |
| Attribute | download | string | undefined | Suggested download name. |
| Attribute | type | 'button' | 'submit' | 'reset' | Native form action. |
| Attribute | form | string | ID of the associated form. |
| Attribute | name | string | Submitter name. |
| Attribute | value | string | Submitter value. |
| Event | war-click | CustomEvent<{type:string}> | Cancelable event before activation. |
| Slot | (default) | — | Visible label or icon. |
| Slot | start | — | Leading content. |
| Slot | end | — | Trailing content. |
| CSS part | base | — | Native control. |
| CSS part | label | — | Label wrapper. |
| CSS part | start | — | Leading content wrapper. |
| CSS part | end | — | Trailing content wrapper. |
| CSS part | spinner | — | Loading indicator. |
| CSS property | --war-button-background | — | Custom background. |
| CSS property | --war-button-foreground | — | Custom foreground. |
| CSS property | --war-button-border | — | Custom border color. |