// Generated by scripts/generate-showcase.mjs. Do not edit directly. page PreferenceSwitcherDetail { layout = "showcase" state playground_size = ctx.url.searchParams.get("pg_size") ?? "default" state playground_color = ctx.url.searchParams.get("pg_color") ?? "primary" state playground_themeLabel = ctx.url.searchParams.get("pg_themeLabel") ?? "Preference Switcher" state playground_colorLabel = ctx.url.searchParams.get("pg_colorLabel") ?? "Preference Switcher" state playground_languageLabel = ctx.url.searchParams.get("pg_languageLabel") ?? "Preference Switcher" state playground_languages = ctx.url.searchParams.get("pg_languages") ?? "" state playground_colors = ctx.url.searchParams.get("pg_colors") ?? "" state playground_compact = ctx.url.searchParams.get("pg_compact") ?? "false" state playground_class = ctx.url.searchParams.get("pg_class") ?? "showcase-instance showcase-instance--1" seo { title = "Preference Switcher" description = "Accessible theme, accent color, and language preference controls." } view {
Navigation component

Preference Switcher

Accessible theme, accent color, and language preference controls.

9 props0 slots3 eventsTheme readyResponsive
Interactive playground

Configure Preference Switcher

Change any prop and inspect the server-rendered component immediately.

Live preview
Component code
<PreferenceSwitcher
  themeLabel="Preference Switcher"
  colorLabel="Preference Switcher"
  languageLabel="Preference Switcher"
  compact="false"
/>
Component props9 controls
Live examples

Designed for real product surfaces

Compare configurations and resize the browser to check responsive behavior.

Recommended

Production default

Balanced spacing, hierarchy, and content for the most common product workflow.

01
Live preview
Component usage.wrn
<PreferenceSwitcher
  themeLabel="Preference Switcher"
  colorLabel="Preference Switcher"
  languageLabel="Preference Switcher"
  compact="false"
/>
Dense UI

Compact application

A tighter variation for dashboards, side panels, tables, and operational interfaces.

02
Live preview
Component usage.wrn
<PreferenceSwitcher
  size="sm"
  themeLabel="Compact example"
  colorLabel="Compact example"
  languageLabel="Compact example"
/>
Extended

Rich configuration

A more expressive variation using additional data, stronger emphasis, and optional states.

03
Live preview
Component usage.wrn
<PreferenceSwitcher
  size="lg"
  themeLabel="Advanced example"
  colorLabel="Advanced example"
  languageLabel="Advanced example"
  compact="false"
/>
Component events

Events

Public events declared by this component. Custom events bubble from the component root and expose state through event.detail.

@themeFires when the component emits the theme event.
@colorFires when the component emits the color event.
@languageFires when the component emits the language event.
Event listener.js
const component = document.querySelector('[data-wrn-events]')

component.addEventListener('theme', (event) => {
  console.log(event.detail)
})
Component API

Props and configuration

All content and behavior shown above is supplied through these props and slots.

PropTypeDefaultRequired
sizestring"default"No
colorstring"primary"No
themeLabelstring"Theme"No
colorLabelstring"Accent color"No
languageLabelstring"Language"No
languagesstring[No
colorsstring[No
compactbooleantrueNo
classstring""No
} }