swatch-group

Swatch Group

A row or column of swatches for choosing one option, such as a colour, or several, as in a filter; joins a Field around it.

Parts

PartFileDoes
SwatchGroupSwatchGroup.vueGroups swatches so the user can choose one or several options.
SwatchGroupItemSwatchGroupItem.vueLets the user select one option within its swatch group.

Anatomy

<SwatchGroup>
  <SwatchGroupItem />
</SwatchGroup>

Styling

All of Swatch Group’s styles live in swatch-group.json. New to styling in Frontic UI? How styling works →

Install

Installs with it
swatch
use-field-control
npm packages
@vueuse/core
class-variance-authority
reka-ui

Built from

API reference

SwatchGroup.vue

Groups swatches so the user can choose one or several options.

Props 16

PropTypeDefault
rovingFocusbooleantrue
disabledbooleanfalse
orientation'vertical' | 'horizontal''horizontal'
dirDirection—
loopbooleantrue
asChildbooleanfalse
asAsTag | Component—
namestring—
requiredbooleanfalse
typeSingleOrMultipleType—
modelValueAcceptableValue | AcceptableValue[]—
defaultValueAcceptableValue | AcceptableValue[]—
classClassValue—
sizeSwatchSize—
shapeSwatchShape—
labelClassClassValue—

Events 1

EventPayload
update:modelValuepayload: AcceptableValue | AcceptableValue[]

Recipe swatch-group 3 groups

SwatchGroupItem.vue
Swatch Group
State