Menus & navigation JS behaviour

Chain selector

A network picker: the trigger’s glyph morphs into the chosen chain and the panel is a searchable list of networks.

Real scenarios

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

Pay with the network you trust

Every network’s glyph is stacked inside the trigger; the chosen one morphs in while the panel folds away. The panel search matches names, symbols and tags — try “l2”.

On the server: ethereum

The receipt follows the choice

Ethereum L1 ETH
Estimated gas 14.2 gwei

Change the network above — the morph plays in the trigger and this card re-renders with the new fee.

Important props

Important props
Prop Type Default What it does
chains array [] Each chain: id, name, symbol, tag, icon and tone (lapis · violet · cyan · gold).
value / wire:model string null The picked chain; also posts through a hidden input.
label / placeholder string «شبکه» The trigger label and the search placeholder.

Snippet

<x-nx::chain-selector name="network" :value="$state['network'] ?? 'ethereum'"
    wire:model.live="state.network" :chains="[
        ['id' => 'ethereum', 'name' => 'Ethereum', 'symbol' => 'ETH', 'tag' => 'L1', 'icon' => 'zap', 'tone' => 'lapis'],
        ['id' => 'polygon', 'name' => 'Polygon', 'symbol' => 'POL', 'tag' => 'L2', 'icon' => 'layers', 'tone' => 'violet'],
    ]" />