Skip to content
LoidoltTheme 0.11.1
Svelte 5

Component

SwatchGroup

A palette as a real radio group — one pressed swatch, arrow-key movement.

import { SwatchGroup } from '@loidolt/theme-svelte';

Example

Accent color

Notes

  • Each swatch is a native radio with a visually hidden input, so keyboard and form semantics come from the platform.
  • Name every color via label when the value alone would not identify it.

Props

Generated from the component source, so it cannot drift from the implementation.

SwatchGroup props
PropTypeDefaultNotes
options required SwatchOption<T>[]—
class string—
disabled booleanfalse
label string—Visible group label, rendered as a <legend>.
name string$props.id()Shared name for the radios. Defaults to an SSR-stable generated id.
onValueChange (value: T) => void—
ref bindableHTMLFieldSetElement | nullnull
size 'sm' | 'md''md'
value bindableT—

Plus the attributes of HTMLFieldsetAttributes, forwarded to the root element.