Disabled and soft-disabled buttons
stable
Compare a disabled action with a discoverable action that cannot be activated.
Live example
Expected behavior
Tab skips the disabled button and reaches the soft-disabled one. Neither action can be activated.
Source
<war-button disabled>Disabled action</war-button>
<war-button soft-disabled>Soft-disabled action</war-button><WarButton disabled>Disabled action</WarButton>
<WarButton softDisabled>Soft-disabled action</WarButton><war-button-angular [disabled]="true">Disabled action</war-button-angular>
<war-button-angular [softDisabled]="true">Soft-disabled action</war-button-angular><WarButton disabled>Disabled action</WarButton>
<WarButton soft-disabled>Soft-disabled action</WarButton><WarButton Disabled="true">Disabled action</WarButton>
<WarButton SoftDisabled="true">Soft-disabled action</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. |