Swatch
Each swatch is a native radio, so arrow keys move between options and the
choice submits with a form. Group swatches that share a name in a
fieldset, or use Variant picker, which does
that for you. A colour swatch hides its label visually and shows it as a
tooltip on hover.
Options
Section titled “Options”id,name,value,label: requiredcolor: any CSS colour; when set the swatch defaults to a colour dotvariant:swatch(default whencoloris set) oroutline(default otherwise)size:compact,regular(default)checked,disabledand otherinputattributes pass to the radio. A disabled outline swatch is faded and struck through
<Swatch id="colour-sand" name="colour" value="sand" label="Sand" color="#d8c7a8" checked /><Swatch id="size-m" name="size" value="m" label="M" />