// Generated by scripts/generate-showcase.mjs. Do not edit directly. page TabsDetail { layout = "showcase" state playground_color = ctx.url.searchParams.get("pg_color") ?? "primary" state playground_size = ctx.url.searchParams.get("pg_size") ?? "default" state playground_items = JSON.parse(ctx.url.searchParams.get("pg_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\"]}]") state playground_active = ctx.url.searchParams.get("pg_active") ?? "" state playground_orientation = ctx.url.searchParams.get("pg_orientation") ?? "horizontal" state playground_mode = ctx.url.searchParams.get("pg_mode") ?? "client" state playground_param = ctx.url.searchParams.get("pg_param") ?? "tab" state playground_label = ctx.url.searchParams.get("pg_label") ?? "Tabs" state playground_class = ctx.url.searchParams.get("pg_class") ?? "showcase-instance showcase-instance--1" seo { title = "Tabs" description = "Switch between related responsive content panels with horizontal or vertical orientation and selection events." } view {
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
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
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
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
} }