Menus & navigation JS behaviour

Chip filter

A single-select row of chips; the accent springs under the checked one and the row’s edges fade while it scrolls.

Real scenarios

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

Filtering a real shelf

Tick a category — the thumb springs under the chip and the shelf below refilters server-side through wire:model. The row scrolls and fades at its edges when it overflows.

7 of 7 items on the shelf

Wool coat hot
2,450,000 tomans
Linen shirt
890,000 tomans
Cotton socks
120,000 tomans
Design systems, the book hot
640,000 tomans
Motion handbook
480,000 tomans
Wooden rattle
260,000 tomans
Building blocks hot
520,000 tomans

Important props

Important props
Prop Type Default What it does
options array [] Key → a plain label, or an array with «label», «icon» and «disabled».
counts array [] A count per key (rendered as given — pass the raw value).
value / wire:model string کلید اول The active option; wire:model sits on the radios and survives the morph.
label string «فیلتر» The group’s accessible label.

Snippet

<x-nx::chip-filter label="دسته‌بندی" :value="$state['cat'] ?? 'all'" wire:model.live="state.cat"
    :options="[
        'all' => 'همه',
        'clothes' => ['label' => 'پوشاک', 'icon' => 'heart'],
        'books' => ['label' => 'کتاب', 'icon' => 'file'],
    ]" :counts="['clothes' => 18, 'books' => 7]" />