"use client";
import { AccentSwitcher } from "@pixxl-tools/components";| Prop | Type | Default | Description |
|---|---|---|---|
defaultValue | AccentPresetName | — | Uncontrolled start value outside a SitePreferencesProvider. |
label | string | "Accent color" | Group name (default "Accent color"). |
name | string | a generated id | name of the radio inputs (default: a generated id). |
onValueChange | (accent: AccentPresetName) => void | — | Called with the chosen preset (also inside a provider). |
options | readonly AccentPresetName[] | all ten | Presets offered, in order (default: all ten). |
showLabels | boolean | names are the radios' accessible names and tooltips | Show each preset's name next to its swatch (default: names are the radios' accessible names and tooltips). |
value | AccentPresetName | — | Selected preset (controlled). Default: the nearest SitePreferencesProvider's accent, which the switcher then changes and persists; else its own state. |
defaultValueAccentPresetName
Uncontrolled start value outside a SitePreferencesProvider.
labeldefault "Accent color"string
Group name (default "Accent color").
namedefault a generated idstring
name of the radio inputs (default: a generated id).
onValueChange(accent: AccentPresetName) => void
Called with the chosen preset (also inside a provider).
optionsdefault all tenreadonly AccentPresetName[]
Presets offered, in order (default: all ten).
showLabelsdefault names are the radios' accessible names and tooltipsboolean
Show each preset's name next to its swatch (default: names are the radios' accessible names and tooltips).
valueAccentPresetName
Selected preset (controlled). Default: the nearest SitePreferencesProvider's accent, which the switcher then changes and persists; else its own state.
Other props are passed to the root element (HTMLAttributes<HTMLDivElement>), including className, style, id and aria-* attributes.
Accent: violet
<AccentSwitcher />