Menus & navigation JS behaviour

Theme switch

Light/system/dark on the core theme store; the thumb springs between them and it follows changes made elsewhere (the header toggle, another tab).

Real scenarios

The component as it is used in a product — not a specimen grid.

The appearance row

Native radios under one springy thumb — keyboard and screen-reader friendly. Flip it, then flip the header toggle: both read the same store (watch another tab follow along).

Interface theme

The preference lives in localStorage under nabu.theme and applies before first paint through the inline theme script.

Preset and named for forms

value picks the starting radio (the store leads afterwards) and name lets a plain form post the choice.

value="dark"
value="light"

Important props

Important props
Prop Type Default What it does
value string system light · system · dark — the starting value; afterwards the theme store leads.
name string nx-theme The radios’ name for in-form posting.
label string «پوسته» The radio group’s label.
nx-change event — Fired with preference on every pick.

Snippet

<x-nx::theme-switch label="پوسته" x-on:nx-change="$wire.ping('پوسته: ' + $event.detail.preference)" />