Glass
JS behaviour
Glass segmented
A single-choice segmented control whose selection is a lens you can drag; it rides native radios and syncs through wire:model.
Real scenarios
The component as it is used in a product — not a specimen grid.
This quarter’s revenue, one lens
31,650,000 tomans
+12%
402 orders
The lens springs on click — or grab it and drag it across.
Thick glass, icons, one disabled
grid
Important props
| Prop | Type | Default | What it does |
|---|---|---|---|
| options | array | [] | Key → a label, or an array with «label», «icon» and «disabled». |
| value / wire:model | string | کلید اول | The active option; the lens springs or is dragged to it. |
| preset / label | string | regular · null | The glass body and the group’s accessible label. |
Snippet
<x-nx::glass-segmented label="دوره" :value="$state['period'] ?? 'week'" wire:model.live="state.period"
:options="['day' => 'روز', 'week' => 'هفته', 'month' => 'ماه']" />