Right-to-left button layout
stable
Set text direction on the container to mirror the button layout.
Live example
Expected behavior
In right-to-left mode, the leading cue moves to the inline start on the right.
Source
<div dir="rtl" lang="ar">
<war-button><span slot="start" aria-hidden="true">+</span>متابعة</war-button>
</div><div dir="rtl" lang="ar">
<WarButton><span slot="start" aria-hidden="true">+</span>متابعة</WarButton>
</div><div dir="rtl" lang="ar">
<war-button-angular><span slot="start" aria-hidden="true">+</span>متابعة</war-button-angular>
</div><div dir="rtl" lang="ar">
<WarButton><template #start><span aria-hidden="true">+</span></template>متابعة</WarButton>
</div><div dir="rtl" lang="ar">
<WarButton><ChildContent>متابعة</ChildContent><StartContent><span aria-hidden="true">+</span></StartContent></WarButton>
</div>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. |