GitHubGitHub
← All components
Navigation / component

Tabs

A typed tab list with caller-provided Svelte snippets.

SelectedUnselected

Overview content with caller-owned markup.

<Tabs items={items} bind:value />

Installation

pnpm add @chanrg/4ui

Import the stylesheet once, at the root of your app:

import '@chanrg/4ui/styles.css';

Usage

import { Tabs } from '@chanrg/4ui';<Tabs items={items} bind:value />

API reference

Props

PropTypeDefaultDescription
itemsTabItem[]requiredLabels and panel snippets.
valuestringfirst itemBindable selected tab.

CSS variables

VariableDescription
--4ui-surfacePrimary component surface.
--4ui-textPrimary foreground color.
--4ui-borderDefault control and panel border.

Accessibility

  • Uses tablist, tab, and tabpanel semantics.

Dependencies

No runtime component dependencies.