component

Tab

props · 28 shown · 28 total

TabGroup

State

  • defaultTab svelte
    string

    Initial selected tab id when `selectedTab` is not bound; defaults to the first non-disabled tab.

  • selectedTab svelte
    string

    Bindable selected tab id.

Appearance

  • "transparent" "surface.peak" "surface.hill" "surface.base" "surface.valley" "surface.ground"

    Background treatment of the tab group surface.

  • "none" "default" "bold" "muted" "accent"

    Border style of the tab group surface.

  • "primary" "secondary" "tertiary"

    Visual emphasis level of the tab group surface.

  • "inherit" "2xl" "lg" "md" "sm" "xl" "inner" "xs" "none" "2xs" "3xl" "4xl" "5xl" "6xl" "full"

    Corner radius of the tab group surface.

  • "inherit" "cyan" "danger" "dynamic" "mauve" "neutral" "pink" "primary" "sage" "slate" "stone" "success" "teal" "violet" "warning"

    Tone color applied to the tab group surface.

  • boolean

    Whether the tab group surface uses a translucent background.

Layout

  • "2xl" "lg" "md" "sm" "xl" "xs" "none" "2xs" "3xl" "4xl" "5xl" "6xl" "10xl" "11xl" "3xs" "4xs" "7xl" "8xl" "9xl"

    Inner padding of the tab group surface.

Behavior

  • boolean

    Whether the tab group surface responds to hover/interaction states.

Events

  • onTabChange svelte
    (tabId: string) => void

    Fires when the user changes the selected tab.

Advanced

  • id svelte
    string

    Explicit id for the tab group (also used as the radio-group id). Generated when omitted.

  • TabPassThrough<RootElementAttributes>

    Per-slot style and attribute override bag for the tab group's slots.

  • boolean
    default false

    Astro / vanilla: serialize the props into `data-tab-group-config` so the client runtime hydrates this instance and `getPindoba(el, "tab-group")` can `update()` it. Astro sets it on every instance (tabs are interactive by nature). Frameworks with their own reactivity don't need it.

Plus all standard <div> HTML attributes.

TabNav

Appearance

  • "buttons" "tabs"
    default "tabs"

    Visual treatment of the tab strip. `"tabs"` (the default) renders the minimal underline tab strip (Radio `appearance="tab"` — transparent tabs, a 2px accent bar under the selected one, and a baseline track); `"buttons"` renders each tab as a segmented button (Radio `appearance="button"`).

  • boolean
    default true

    Paint the selection as one thumb that slides between tabs — the accent bar for `appearance="tabs"`, the raised pill for `"buttons"`. `false` keeps a static per-tab selection.

Layout

  • boolean
    default false

    Whether tabs stretch to fill the strip. Off by default: tabs hug their labels and sit at the start, while the baseline track still spans the full width.

Behavior

  • "responsive" "popover" "inline"
    default responsive

    How the action slots are displayed relative to the tab strip.

  • tabs required
    readonly TItem[]

    Array of tab navigation items with id and label (plus per-tab extras).

Slots

  • leftAction slot svelte
    Snippet

    Content rendered before the scrollable tab strip.

  • rightAction slot svelte
    Snippet

    Content rendered after the scrollable tab strip.

Advanced

  • TabPassThrough

    Per-slot style and attribute override bag for the nav slots.

  • boolean
    default false

    Astro / vanilla: serialize the props into `data-tab-nav-config` so the client runtime hydrates this instance and `getPindoba(el, "tab-nav")` can `update()` it. Astro sets it on every instance (tabs are interactive by nature). Frameworks with their own reactivity don't need it.

Plus all standard <nav> HTML attributes.

TabPanel

Behavior

  • id required
    string

    Unique identifier matching a tab ID — the panel's HTML id will be `panel-${id}`.

Accessibility

  • string

    Explicit ID of the element labeling this panel (overrides the `groupId`-derived default; with neither, the attribute is omitted).

  • string

    The tab group's id — `aria-labelledby` derives from it via the shared tab-element id shape, pointing at the visible `role="tab"` element.

Advanced

  • TabPassThrough

    Per-slot style and attribute override bag for the panel slots.

  • boolean
    default false

    Astro / vanilla: serialize the props into `data-tab-panel-config` so the client runtime hydrates this instance and `getPindoba(el, "tab-panel")` can `update()` it. Astro sets it on every instance (tabs are interactive by nature). Frameworks with their own reactivity don't need it.

Plus all standard <div> HTML attributes.

Type

  • Components
  • Blocks