Tabs

Tabs component documentation for Velyx. Installation, usage examples, variants, and customization guidance for Laravel Blade, Alpine.js, Livewire, and Tailwind CSS v4.

Tabs

Tabs organize related content into focusable panels so users can switch context without leaving the page.

Installation

Add the tabs component to your project:

npx velyx@latest add tabs
pnpm dlx velyx@latest add tabs
yarn dlx velyx@latest add tabs
bunx --bun velyx@latest add tabs

Alpine.js Required: The tabs component uses Alpine.js for active state and keyboard interactions.

Usage

Underline Tabs

Tabs

Live preview rendered from the registry in an isolated iframe.

Open preview

Loading preview...

Failed to load preview

Code

Tabs

Full preview from the registry iframe.

Loading preview...

Pills Variant

Tabs

Live preview rendered from the registry in an isolated iframe.

Open preview

Loading preview...

Failed to load preview

Code

Tabs

Full preview from the registry iframe.

Loading preview...

Enclosed Variant

Tabs

Live preview rendered from the registry in an isolated iframe.

Open preview

Loading preview...

Failed to load preview

Code

Tabs

Full preview from the registry iframe.

Loading preview...

Props

Tabs Root

Prop Type Default Description
default string | null null The tab that should be active on initial render
variant string 'underline' Visual style for the tabs: underline, pills, or enclosed

Tabs Trigger

Prop Type Default Description
tab string required Unique identifier for the tab and its matching panel
icon string | null null Optional Lucide icon shown before the label
variant string 'underline' Matches the list/root variant for consistent styling

Tabs Content

Prop Type Default Description
tab string required The tab id this panel belongs to

Example Structure

<x-ui.tabs.tabs default="overview" variant="underline">
    <x-ui.tabs.list variant="underline">
        <x-ui.tabs.trigger tab="overview" variant="underline">Overview</x-ui.tabs.trigger>
        <x-ui.tabs.trigger tab="activity" variant="underline">Activity</x-ui.tabs.trigger>
        <x-ui.tabs.trigger tab="settings" variant="underline">Settings</x-ui.tabs.trigger>
    </x-ui.tabs.list>

    <x-ui.tabs.content tab="overview">
        Overview content
    </x-ui.tabs.content>

    <x-ui.tabs.content tab="activity">
        Activity content
    </x-ui.tabs.content>

    <x-ui.tabs.content tab="settings">
        Settings content
    </x-ui.tabs.content>
</x-ui.tabs.tabs>

Accessibility

Tabs include accessible roles and keyboard navigation:

  • Arrow Left / Arrow Right - Move focus between tab triggers
  • Enter / Space - Activate the focused tab
  • ARIA roles - Uses tablist, tab, and tabpanel
  • Focus states - Visible focus ring for keyboard users

Next Steps