Glass
JS behaviour
Glass tab bar
A floating glass tab bar; the active tab sits under the lens and it shrinks itself as the content scrolls.
Real scenarios
The component as it is used in a product — not a specimen grid.
A travel app’s bottom bar
Scroll the feed — the bar shrinks itself out of the way; the active tab sits under the lens and the pick lands in Livewire.
Kyoto
Lisboa
Marrakech
Reykjavík
Istanbul
Seoul
Istanbul
Active tab on the server: Home
Compact, and made of links
Items with href become real anchors.
Important props
| Prop | Type | Default | What it does |
|---|---|---|---|
| items | array | [] | Each tab: value, label and icon; with href it links, without it the button binds to value (and wire:model). |
| value / wire:model | string | null | The active tab. |
| minimize-on-scroll | bool · selector | false | true watches the window; a CSS selector watches that scrolling container. |
| compact / preset | bool · string | false · regular | Start shrunk, and the glass body. |
Snippet
<x-nx::glass-tab-bar label="اصلی" :value="$state['tab'] ?? 'home'" wire:model.live="state.tab"
minimize-on-scroll=".feed-scroll" :items="[
['value' => 'home', 'label' => 'خانه', 'icon' => 'home'],
['value' => 'saved', 'label' => 'ذخیرهها', 'icon' => 'heart'],
]" />