Skip to content
LoidoltTheme 0.11.1
Svelte 5

Component

PresetPicker

Switches between style presets — colours, corners, density and voice — wired to `createTheme({ presets })`.

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

Example

Preset: loidolt / scheme: light

Notes

  • Import each preset stylesheet you list in presets; the picker only switches the data-preset attribute.
  • Pair it with ThemeToggle: presets and colour schemes are independent, so every preset has a light and a dark side.
  • Use variant="select" where space is tight, such as a top bar; the segmented form keeps every preset in view.

Props

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

PresetPicker props
PropTypeDefaultNotes
theme required Theme<P>—The store from createTheme({ presets }).
class string—
label string'Style'Accessible name of the control.
options Option<P>[]—Label per preset. Defaults to the built-in presets' own labels, and to the capitalised name for any preset of your own.
size ControlSize'sm'
variant 'segmented' | 'select''segmented'segmented keeps every preset in view; select folds a longer list into a dropdown.