Button sizes and width
stable
Choose a size and optionally fill the available width.
Live example
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><WarButton size="lg" fullWidth>Continue</WarButton><war-button-angular size="lg" [fullWidth]="true">Continue</war-button-angular><WarButton size="lg" full-width>Continue</WarButton><WarButton Size="lg" FullWidth="true">Continue</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. |