Tabs | UI Showcase
WRNexus UI
Navigation component

Tabs

Switch between related responsive content panels with horizontal or vertical orientation and selection events.

9 props2 slots2 outputsTheme readyResponsive
Interactive playground

Configure Tabs

Change any prop and inspect the server-rendered component immediately.

Live preview

Primary workflow

A clean default configuration for everyday product interfaces.

Supporting example

A clean default configuration for everyday product interfaces.

Component code
<Tabs
  items='[
    {
      "id": "tabs-0-1",
      "key": "tabs-0-1",
      "value": "primary",
      "label": "Primary workflow",
      "title": "Primary workflow",
      "description": "A clean default configuration for everyday product interfaces.",
      "text": "A configurable sample message.",
      "href": "#tabs-demo",
      "actionHref": "#tabs-demo",
      "actionLabel": "View details",
      "icon": "icon-[lucide--sparkles]",
      "iconClass": "icon-[lucide--sparkles]",
      "variant": "primary",
      "status": "Active",
      "time": "09:30",
      "current": true,
      "selected": true,
      "checked": true,
      "disabled": false,
      "outgoing": false,
      "open": true,
      "number": 1,
      "count": 16,
      "percentage": 72,
      "color": "#7c3aed",
      "target": "_self",
      "ariaLabel": "Open primary workflow 1",
      "items": [
        {
          "label": "Nested option A",
          "value": "nested-a"
        },
        {
          "label": "Nested option B",
          "value": "nested-b"
        }
      ],
      "links": [
        {
          "label": "Documentation",
          "href": "#documentation"
        },
        {
          "label": "API reference",
          "href": "#api-reference"
        }
      ],
      "values": [
        "Included",
        "Standard"
      ]
    },
    {
      "id": "tabs-0-2",
      "key": "tabs-0-2",
      "value": "secondary",
      "label": "Additional option",
      "title": "Supporting example",
      "description": "A clean default configuration for everyday product interfaces.",
      "text": "Another configurable message.",
      "href": "#tabs-demo",
      "actionHref": "#tabs-demo",
      "actionLabel": "View details",
      "icon": "icon-[lucide--sparkles]",
      "iconClass": "icon-[lucide--sparkles]",
      "variant": "primary",
      "status": "Active",
      "time": "09:30",
      "current": false,
      "selected": false,
      "checked": false,
      "disabled": false,
      "outgoing": true,
      "open": true,
      "number": 2,
      "count": 32,
      "percentage": 72,
      "color": "#7c3aed",
      "target": "_self",
      "ariaLabel": "Open primary workflow 2",
      "items": [
        {
          "label": "Nested option A",
          "value": "nested-a"
        },
        {
          "label": "Nested option B",
          "value": "nested-b"
        }
      ],
      "links": [
        {
          "label": "Documentation",
          "href": "#documentation"
        },
        {
          "label": "API reference",
          "href": "#api-reference"
        }
      ],
      "values": [
        "Included",
        "Standard"
      ]
    }
  ]'>
  <div data-slot="panel-{valueOf(item, index)}">
    <div class="showcase-slot">panel-{value Of(item, index)} slot</div>
  </div>
</Tabs>
Event outputInteract with the preview to inspect the typed payload.
Component props9 controls
Live examples

Designed for real product surfaces

Compare configurations and resize the browser to check responsive behavior.

Recommended

Horizontal content tabs

Switch between related content panels without navigating away.

01
Live preview

Overview content

Requirements content

Process content
Component usage.wrn
<Tabs
  items='[
    {
      "label": "Overview",
      "value": "overview",
      "content": "Overview content"
    },
    {
      "label": "Requirements",
      "value": "requirements",
      "content": "Requirements content"
    },
    {
      "label": "Process",
      "value": "process",
      "content": "Process content"
    }
  ]'
  active="overview"
  label="Service information">
  <div data-slot="panel-{valueOf(item, index)}">
    <div class="showcase-slot">panel-{value Of(item, index)} slot</div>
  </div>
</Tabs>
Advanced

Mirrored into the URL

With mode=url the selection is written to a query parameter using pushState, so the panel swaps without a page load, the tab survives a reload, and the back button steps through the tabs you visited.

02
Live preview

Profile and credentials.

Invoices and payment method.

Members and their roles.

Component usage.wrn
<Tabs
  size="sm"
  items='[
    {
      "label": "Account",
      "value": "account",
      "description": "Profile and credentials."
    },
    {
      "label": "Billing",
      "value": "billing",
      "description": "Invoices and payment method."
    },
    {
      "label": "Team",
      "value": "team",
      "description": "Members and their roles."
    }
  ]'
  active="account"
  mode="url"
  label="Account settings">
  <div data-slot="panel-{valueOf(item, index)}">
    <div class="showcase-slot">panel-{value Of(item, index)} slot</div>
  </div>
</Tabs>
Compact

Compact application tabs

Use smaller tabs in dashboards, panels, and dense product interfaces.

03
Live preview

Component usage.wrn
<Tabs
  size="sm"
  items='[
    {
      "label": "Details",
      "value": "details"
    },
    {
      "label": "History",
      "value": "history"
    },
    {
      "label": "Files",
      "value": "files"
    }
  ]'
  active="details"
  label="Record views">
  <div data-slot="panel-{valueOf(item, index)}">
    <div class="showcase-slot">panel-{value Of(item, index)} slot</div>
  </div>
</Tabs>
Advanced

Vertical settings tabs

Use vertical tabs for settings, configuration, and long-form navigation.

04
Live preview

Component usage.wrn
<Tabs
  size="lg"
  items='[
    {
      "label": "Profile",
      "value": "profile",
      "icon": "icon-[lucide--user]"
    },
    {
      "label": "Security",
      "value": "security",
      "icon": "icon-[lucide--shield]"
    },
    {
      "label": "Notifications",
      "value": "notifications",
      "icon": "icon-[lucide--bell]"
    }
  ]'
  active="security"
  orientation="vertical"
  label="Settings">
  <div data-slot="panel-{valueOf(item, index)}">
    <div class="showcase-slot">panel-{value Of(item, index)} slot</div>
  </div>
</Tabs>
Component outputs

Receive every typed component output

Use declarative output handlers in .wrn files or register a direct output handler from JavaScript. The canonical API exposes payload and does not require event.detail.

@changeFires when the component's committed value or selection changes.
@selectFires when an item, option, card, or result is selected.
Declarative handlers.wrn
<Tabs
  @change='console.log(payload)'
  @select='console.log(payload)'
/>
Direct output handlers.js
import { registerOutputHandler } from "@wrnexus/csr/outputs"

const component = document.querySelector("[data-ui-component=\"Tabs\"], [data-component=\"Tabs\"]")

if (component) registerOutputHandler(component, "change", (payload) => {
  console.log("change", payload)
})

if (component) registerOutputHandler(component, "select", (payload) => {
  console.log("select", payload)
})
Component API

Props and configuration

All content and behavior shown above is supplied through these props and slots.

PropTypeDefaultRequired
colorstring"primary"No
sizestring"default"No
itemsunknown[][]No
activestring""No
orientationstring"horizontal"No
modestring"client"No
paramstring"tab"No
labelstring"Tabs"No
classstring""No