Components
BaseIconButton
A square button with only an icon, for toolbars, table rows and compact actions. It wraps v-icon-btn.
Types
button-type takes the same types as BaseButton, so an icon button next to a text button has the same weight and colour. The default is ghost, which takes the colour of the surrounding text, so a toolbar button works on any background and a text-medium-emphasis class still tints it. variant and color still override the type.
On a coloured background
on-color and overlay read the colour of the surface, like in BaseButton. Pass surface when the background is not primary.
Sizes and loading
Navigate with a tooltip
v-icon-btn has no to or href, so navigate with @click="navigateTo(...)". Wrap the button in BaseTooltip to show its name on hover.
API
Props
Name | Type | Default | Description |
|---|---|---|---|
button-type | any | "ghost" | The role of the button, shared with BaseButton: ghost (the default, inherits the text colour), primary, secondary, tertiary, default, inverse, danger, overlay or on-color. |
surface | string | "primary" | The theme colour of the surface behind an on-color button. Defaults to primary. |
variant | any | — | Overrides the Vuetify variant that button-type picks. |
color | string | — | Overrides the colour that button-type picks. |
It always uses rounded="lg", so every icon button in the app has the same shape.
Accessibility
aria-labelis required: the icon alone says nothing to a screen reader.- Add a
BaseTooltipwith the same text for sighted users, and the keyboard shortcut in itskeyswhen there is one.