Appearance
Button
SCAButton is the base button. It renders a native <button> (or any component through as), an optional left and right icon, a label and an optional dropdown caret. For a square icon-only button use SCAIconButton. Icon names are typed (IconName): see Icons for the full list.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
type | 'default' | 'ghost' | 'bare' | 'toggle' | 'default' | Visual weight: filled, outlined, text only, or a toggle that shows selected. |
size | 'xsmall' | 'small' | 'medium' | 'large' | 'medium' | xsmall renders like small. |
appearance | 'primary' | 'secondary' | 'inverted' | 'reverseInverted' | 'primary' | Colour family. inverted and reverseInverted are for dark backgrounds. |
intent | 'none' | 'success' | 'destructive' | 'none' | Semantic colour of the action. |
iconLeft / iconRight | IconName | — | Icon before / after the label. With loading, the left icon becomes a loader. |
iconSize | string | icon default (20px) | Size of both icons, e.g. '16px'. |
iconMirrorX / iconMirrorY | boolean | false | Flip the left icon. |
hasDropdown | boolean | false | Show a caret-down after the label. |
loading | boolean | false | Disable the button and show a loader instead of the left icon (needs iconLeft). |
disabled | boolean | false | Disable the button. |
selected | boolean | false | Selected state, e.g. for type="toggle" or an open dropdown trigger. |
shadow | boolean | true | Drop shadow on the filled button. |
tooltip / title | string | — | Tooltip text (tooltip wins over title). |
gap | string | '8px' | Space between icon, label and caret. |
paddingLeft / paddingRight | string | '12px' | Horizontal padding. |
as | string | Component | 'button' | Root element or component, e.g. RouterLink. A non-button root gets aria-disabled while disabled or loading. |
Slots
| Slot | Description |
|---|---|
default | The label. |
special | Content between the label and the right icon. |
The button has no emits: listen to @click on it. Icons follow the button's text colour. The button sets --sca-icon-color on itself, so a value set on a wrapper never reaches them. To recolour the icons, use @include Globals.icon-color(...) on a class passed to the button, or change the button's color (see Icons).