Components

BaseSwatchPicker

A single choice among colour swatches or icons, shown as tiles.

components/ui/inputs/BaseSwatchPicker.vue
View in the demo

Example

Pick a colour and the icons follow it through tint. The roles editor uses this pair. The selected swatch gets a ✓ and a ring in its own colour, and the label says what is selected. With preview, an icon picker shows the result (the icon in its colour) on the left.

Colour · primary
Icon · user-cog

API

Props

Name
Type
Default
Description
items
required
BaseSwatchItem[]—The swatches, each { value, label, color? , icon? }.
labelstring—The group label.
optionalbooleanfalseAdds “(optional)” after the label. Never mark required fields.
tintstring"primary"The colour of the selected icon.
sizenumber36The size of each tile in pixels. Defaults to 36.
previewbooleanfalseShows the selected icon in the tint colour on the left, as it will look.
v-modelstring—The selected value.

Events

Name
Payload
Description
@update:modelValue[value: string | undefined]—

Accessibility

It is a radio group with a single tab stop: the arrows, Home and End change the selection (RTL included), and each swatch has its label as accessible name and tooltip. The selection does not rely on colour alone: the ✓ and the name in the label show it too.

© 2026 melsami UI.
Developer documentation for melsami UI.