v0.0.2
Demos (demo panel, opens in a new tab)

Tabs

Splits content into tabs shown in the same area; switching tabs does not reload the page.

zb:tabs zubazar/ui · free (MIT)

Basic usage

Basic usage: view
BLADE

Tabs are generated from the tabs array (key => title); the value of each zb:tab-panel matches a key.

blade
<zb:tabs :tabs="['general' => 'General', 'orders' => 'Orders', 'history' => 'History']">
    <zb:tab-panel value="general"><p class="text-sm text-dim">Premium member · Kadıköy, Istanbul</p></zb:tab-panel>
    <zb:tab-panel value="orders"><p class="text-sm text-dim">Last order: September 12, 2026</p></zb:tab-panel>
    <zb:tab-panel value="history"><p class="text-sm text-dim">9 orders and 1 return in 2026.</p></zb:tab-panel>
</zb:tabs>
PropValues
tabs['key' => 'Title', …]
value (tab-panel)Matching tab key

Pills

Pills: view
BLADE

variant="pills" shows the selected tab filled; suited to filters or view switches.

blade
<zb:tabs variant="pills" :tabs="['all' => 'All', 'pending' => 'Pending', 'delivered' => 'Delivered']">
    <zb:tab-panel value="all"><p class="text-sm text-dim">148 orders</p></zb:tab-panel>
    <zb:tab-panel value="pending"><p class="text-sm text-dim">36 orders are waiting to ship.</p></zb:tab-panel>
    <zb:tab-panel value="delivered"><p class="text-sm text-dim">112 orders were delivered.</p></zb:tab-panel>
</zb:tabs>
PropValues
variantunderline | pills

Card tabs

Card tabs: view
BLADE

variant="cards" joins the open tab to the framed panel below it; suited to settings and detail pages.

blade
<zb:tabs variant="cards" :tabs="['general' => 'General', 'shipping' => 'Shipping', 'invoice' => 'Invoice']">
    <zb:tab-panel value="general">Store name, currency and time zone.</zb:tab-panel>
    <zb:tab-panel value="shipping">Carriers and the free shipping threshold.</zb:tab-panel>
    <zb:tab-panel value="invoice">Invoice details and e-invoice settings.</zb:tab-panel>
</zb:tabs>
PropValues
variantunderline | pills | cards

Initial tab

Initial tab: view
BLADE

active sets the tab selected on load; without it, the first key is selected.

blade
<zb:tabs :active="2025" :tabs="[2026 => '2026', 2025 => '2025', 2024 => '2024']">
    <zb:tab-panel value="2026"><p class="text-sm text-dim">2026: 9 orders</p></zb:tab-panel>
    <zb:tab-panel value="2025"><p class="text-sm text-dim">2025: 12 orders, 1 return</p></zb:tab-panel>
    <zb:tab-panel value="2024"><p class="text-sm text-dim">2024: 11 orders</p></zb:tab-panel>
</zb:tabs>
PropValues
activeTab key

Composing from parts

Composing from parts: view
BLADE

Write the tabs with zb:tabs.trigger inside zb:tabs.list and their contents with zb:tabs.panel; wire:model binds the open tab to a Livewire property.

blade
<zb:tabs wire:model="activeTab" variant="underline" size="md">
    <zb:tabs.list aria-label="Store overview">
        <zb:tabs.trigger value="overview">Overview</zb:tabs.trigger>
        <zb:tabs.trigger value="orders" badge="8">Orders</zb:tabs.trigger>
        <zb:tabs.trigger value="settings">Settings</zb:tabs.trigger>
    </zb:tabs.list>

    <zb:tabs.panel value="overview">
        <div class="grid gap-4 sm:grid-cols-3">
            <zb:stat-card label="Orders" value="142" icon="shopping-bag" />
            <zb:stat-card label="Delivered" value="118" icon="check-circle" color="success" />
            <zb:stat-card label="Pending" value="24" icon="clock" color="warning" />
        </div>
    </zb:tabs.panel>
    <zb:tabs.panel value="orders">
        <ul class="divide-y divide-line-soft text-sm">
            <li class="flex items-center justify-between py-2.5">
                <span class="text-ink">Cumhuriyet Dist., 12th St. No. 4</span>
                <zb:badge variant="success">Delivered</zb:badge>
            </li>
            <li class="flex items-center justify-between py-2.5">
                <span class="text-ink">Atatürk Ave. No. 87 Apt. 3</span>
                <zb:badge variant="warning">On the way</zb:badge>
            </li>
        </ul>
    </zb:tabs.panel>
    <zb:tabs.panel value="settings">
        <p class="text-sm text-dim">Store manager: Mehmet Kaya. Shipping cutoff 15:00; orders placed after that ship the next business day.</p>
    </zb:tabs.panel>
</zb:tabs>
PropValues
wire:modelLivewire property the open tab is bound to
sizesm · md · lg
zb:tabs.triggervalue, badge, icon, disabled
zb:tabs.panelvalue

Props

The values the component takes. What are props and slots?

PropTypeDefaultDescription
tabs—[]key => title; the key is a string or a number
active—first keyTab selected on load (compared as a string)
variant—underlineunderline · pills · cards
tab-panel: value— — Required; matching tab key
size—mdsm · md · lg
wire:model · x-model— — Binds the open tab two-way to a property
tabs.trigger: value · badge · icon · disabled— — value is required; badge is a number or short text, icon an icon name
tabs.panel: value— — Required; the matching tabs.trigger value

Advanced

2 examples

Inside a card

Inside a card: view
BLADE

Shorten long pages by splitting record details into tabs inside a card. The class and attributes given to zb:tabs go to the root element, and those given to zb:tab-panel to the panel.

blade
<zb:card title="Customer card" subtitle="Ayşe Yılmaz · #04112">
    <zb:tabs variant="pills" :tabs="['general' => 'General', 'orders' => 'Orders', 'invoices' => 'Invoices']">
        <zb:tab-panel value="general"><p class="text-sm text-dim">Premium member · Kadıköy, Istanbul</p></zb:tab-panel>
        <zb:tab-panel value="orders"><p class="text-sm text-dim">Last order: September 12, 2026</p></zb:tab-panel>
        <zb:tab-panel value="invoices" class="py-2"><zb:empty-state title="No invoices" /></zb:tab-panel>
    </zb:tabs>
</zb:card>

Pill tabs with icons

Pill tabs with icons: view
BLADE

variant="pills" draws filled tabs and wraps them to the next line on narrow screens; a disabled tab cannot be selected and is skipped by the keyboard.

blade
<zb:tabs variant="pills" active="team">
    <zb:tabs.list aria-label="Support view">
        <zb:tabs.trigger value="tickets" icon="inbox">Tickets</zb:tabs.trigger>
        <zb:tabs.trigger value="team" icon="users" badge="6">Team members</zb:tabs.trigger>
        <zb:tabs.trigger value="report" icon="chart-bar">Report</zb:tabs.trigger>
        <zb:tabs.trigger value="archive" icon="archive-box" disabled>Archive</zb:tabs.trigger>
    </zb:tabs.list>

    <zb:tabs.panel value="tickets">
        <p class="text-sm text-dim">142 tickets were opened today; 4 of them are marked urgent.</p>
    </zb:tabs.panel>
    <zb:tabs.panel value="team">
        <p class="text-sm text-dim">6 team members are online: 5 are answering tickets and 1 is on a break.</p>
    </zb:tabs.panel>
    <zb:tabs.panel value="report">
        <p class="text-sm text-dim">September 2026: 3,106 tickets, 94% resolved on the first reply.</p>
    </zb:tabs.panel>
    <zb:tabs.panel value="archive">Archive</zb:tabs.panel>
</zb:tabs>

Developer notes

Events, hooks and details
  • Pill tabs wrap to the next line when they do not fit.
  • Keys can be numbers; because active and value are compared as strings, :active="2025" matches value="2025".
  • wire:model binds the open tab two-way; initialize the property with a value, otherwise the first tab opens.

Accessibility

ARIA and roles
The row has role="tablist", each tab role="tab" and each panel role="tabpanel". A tab points to its panel with aria-selected and aria-controls; the panel is labelled by its tab through aria-labelledby. The ids are unique per zb:tabs.
Keyboard
Left and Right arrows move to the previous or next tab and open it; Home and End go to the first and last tab. Movement wraps at the ends and skips disabled tabs.
Focus
Only the open tab is in the tab order (tabindex="0", the others -1). The next Tab moves into the panel, which has tabindex="0". Keyboard focus shows an outline on the tab.
Disabled
disabled sets the real disabled attribute: the tab cannot be clicked or focused, and the arrow keys skip it.
What you provide
To name the tab row, write the tabs in parts and put aria-label on zb:tabs.list; with the classic tabs array, attributes go on the root element. Give an icon-only tab an aria-label.
Zubazar UI · ZubazarDesigned for people.