Base JS behaviour

Tabs

Full ARIA tabs with a springy pill, arrow/home keyboard roving and three variants; panels come from named slots.

Real scenarios

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

Account settings, one switchboard

The active tab lives in the URL’s component state — reload, walk away, come back: it remembers. Arrow keys roam, Home and End jump.

A file browser with counts

Underline tabs with a badge on each — the pill follows the active tab with a spring.

  • Contract — Nabu 1404.pdf
  • brand-plate.png
  • launch-theme.mp3

Important props

Important props
Prop Type Default What it does
items array [] ['profile' => 'Profile'] or ['key' => ['label' => …, 'icon' => …, 'badge' => …, 'disabled' => …]].
variant string pill pill · underline · enclosed.
wire:model string — The active tab entangles to a Livewire property.

Snippet

<x-nx::tabs :items="['profile' => 'پروفایل', 'security' => 'امنیت']"
    wire:model="state.settingsTab">
    <x-slot:profile>…</x-slot:profile>
    <x-slot:security>…</x-slot:security>
</x-nx::tabs>