Tabs
Basic Usage
Overview
This is the overview content. It provides a general introduction to the topic.
<neura::tabs defaultTab="overview">
<neura::tabs.list>
<neura::tabs.trigger value="overview">Overview</neura::tabs.trigger>
<neura::tabs.trigger value="features">Features</neura::tabs.trigger>
<neura::tabs.trigger value="pricing">Pricing</neura::tabs.trigger>
</neura::tabs.list>
<neura::tabs.content value="overview">
Content for overview tab
</neura::tabs.content>
<neura::tabs.content value="features">
Content for features tab
</neura::tabs.content>
<neura::tabs.content value="pricing">
Content for pricing tab
</neura::tabs.content>
</neura::tabs>
Variants
line
(default) and pills
:
Line Variant (Default)
Content for Tab 1 with line variant.
Pills Variant
With Livewire
activeTab
property exists in the Livewire component:
Overview
Current active tab: None
Settings
Current active tab: None
Profile
Current active tab: None
<neura::tabs>
<neura::tabs.list>
<neura::tabs.trigger value="overview">Overview</neura::tabs.trigger>
</neura::tabs.list>
...
</neura::tabs>
// In your Livewire component:
public $activeTab = null;
With Icons
Welcome home!
<neura::tabs.trigger value="home" class="gap-2">
<neura::icon name="home" class="size-4" />
Home
</neura::tabs.trigger>
Rich Content
Product Overview
This product offers exceptional value with a comprehensive set of features.
Use Cases
Product Details Page
Product description content.
Settings Panel
Account settings content.
Best Practices
Do
- Use clear and descriptive labels for tabs
- Organize content logically by categories
- Limit the number of tabs (3-5 maximum recommended)
- Use
defaultTabto set the default active tab - Add icons to improve navigation
Don't
- Don't create too many tabs (max 5-7)
- Don't use overly long labels
- Don't put too much content in a single tab
- Don't forget to sync state with Livewire if necessary
Properties
| Component | Property | Type | Default | Description |
|---|---|---|---|---|
| tabs | variant | string | 'line' | Tab style: 'line' or 'pills' |
| defaultTab | string|null | null | Default active tab (otherwise the first one) | |
| tabs.list | variant | string | 'line' | List style: 'line' or 'pills' |
| tabs.trigger | value | string | required | Unique tab identifier (must match the content) |
| variant | string | 'line' | Trigger style: 'line' or 'pills' | |
| tabs.content | value | string | required | Unique identifier that matches the trigger |