Navigation & Disclosure
Tabs
Tabs organize content into focusable views and support synchronized groups via the `syncKey` prop. Organize content into understandable destinations and reveal detail when it becomes relevant. Keep the active location or expanded state easy to recognize. Import it from @/components/kamod-ui/tabs.
Source · Design reference · API reference · Theming · Styles
Interactive preview
Preact example Local preview theme · Responsive styles follow the preview widthFull widthInstallation
Install the package and import Tabs, TabsList, TabsTrigger and TabsContent from @/components/kamod-ui/tabs.
pnpm add @kamod-ch/uiCopy an example with @kamod-ch/ui or the matching @kamod-ch/ui/… subpath. The code block switches between those two installs. Connect The Global Theme CSS and Tailwind Source Detection before your first render.
Usage
Tabs organize content into focusable views and support synchronized groups via the syncKey prop.
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@kamod-ch/ui";<Tabs defaultValue="overview">
<TabsList variant="line">
<TabsTrigger value="overview">Overview</TabsTrigger>
<TabsTrigger value="details">Details</TabsTrigger>
</TabsList>
<TabsContent value="overview">Overview content</TabsContent>
<TabsContent value="details">Details content</TabsContent>
</Tabs>Component Examples & Variants
Explore Tabs in Different Contexts, from the starting pattern to the compositions below. Begin with Inset Tabs, then compare the examples that match your content, state and layout. These are working patterns to adapt, not a list of interchangeable variant values: check the API Reference before using a prop or combining behaviors. Look at the surrounding labels, supporting text and spacing as well as the component itself.
Read the Result and Its Implementation Together. Use each showcase’s Code view to inspect imports and composition, or its Prompt view to prepare a setup or adaptation brief. Try the narrow preview and local theme controls before connecting real data, and use Reset to return an example to its initial state. Keep layout changes in class utilities where appropriate; follow the Component Styles Guide for hierarchy and the Theming Guide for shared surfaces and colors. The Accessibility Notes explain what to preserve when making those changes.
Inset Tabs
A clear choice, with a little breathing room. Set variant="inset" on TabsList to opt into rounded tabs with a small theme-primary dot and an inset stripe. Showcase toolbars use the original default variant for rounded controls with a filled selection; page-level selectors use variant="line" for the underlined treatment. All variants use a faint selected background at one third of the normal hover tint, with foreground text. Hovering a selected tab gently strengthens its highlight by the same amount as an unselected tab; the underline stays still. The spaces between tabs grow gently from 6px to a maximum of 10px.
The same behavior in either direction. Use the arrow keys, Home and End to change panels, or set orientation="vertical" on Tabs. Disabled triggers are skipped. The visual variant does not change selection, synchronization or panel mounting, and nested lists keep their own styling.
Keep customization local. Adjust --tabs-inset-height, --tabs-inset-padding and --tabs-inset-font-size on an individual list for compact toolbars. Colors follow the Theme Tokens, and corners follow --radius-md. The original default and line variants remain available; omitting variant still selects default for existing consumers.
Interactive preview
Preact example Local preview theme · Responsive styles follow the preview widthFull widthSynced Tabs
Synchronize Only Groups that Represent the Same Choice. Give related tab groups the same syncKey when they should share an active value. Their trigger values need to describe the same choices, making a selection in one group meaningful in the other synchronized views.
Keep their values compatible and make each group's purpose clear, so changing one panel does not unexpectedly alter a different workflow elsewhere on the page.
Interactive preview
Preact example Local preview theme · Responsive styles follow the preview widthFull widthDisabled Triggers
Explain Unavailable Panels without Making Them a Dead End. Set disabled on a TabsTrigger when its panel is not currently available for selection. Preserve a clear label and explain the prerequisite where necessary, instead of leaving readers to infer the reason from reduced emphasis alone.
Keep the active value on an available tab, place the reason nearby and avoid storing essential instructions only inside the panel users cannot open.
Interactive preview
Preact example Local preview theme · Responsive styles follow the preview widthFull widthNested Tabs
Keep Each Level's Question Distinct. Place an independent tabs group inside a panel when the content has a genuine second level of choices. Keep the nested labels and state scoped to that panel so the inner selection does not compete with the outer navigation.
Use clear group names and independent values or sync keys, and check whether headings or separate pages would make the same content easier to navigate.
Interactive preview
Preact example Local preview theme · Responsive styles follow the preview widthFull widthProps and Data
Configure Tabs using the contracts below. Read the documented options alongside the Source Definitions to understand which values your application supplies and which details the component owns. Start with a prop or helper, then follow its type link to inspect the declaration without leaving the page.
Tabs component props and accepted values.
Type cards are extracted from this checkout’s TypeScript source at build time. Props inherited through HTMLAttributes, Omit or variant helpers remain references in those declarations; their fields are not flattened here. Match the reference to your installed version, and check a package’s exports before writing an import type. A type exported by a source file is not necessarily re-exported by @kamod-ch/ui.
Component Props
? means a field can be omitted; it does not promise a fallback value. Existing documented defaults remain alongside the descriptions. For callbacks, check the argument and return types before connecting your own state or services.Interactive preview
Preact example Local preview theme · Responsive styles follow the preview widthFull widthTabs
TabsProps
| Prop / type | Description |
|---|---|
children | Configure
|
class | Configure
|
defaultValue | Configure
|
orientation | Configure
|
syncKey | Share selection with mounted groups using this key; release it after the last unmount.
|
TabsContent
TabsContentProps
| Prop / type | Description |
|---|---|
children | Configure
|
class | Configure
|
forceMount | Configure
|
id | Configure
|
value | Configure
|
TabsList
TabsListProps
| Prop / type | Description |
|---|---|
children | Configure
|
class | Configure
|
variant | Configure
|
TabsTrigger
TabsTriggerProps
| Prop / type | Description |
|---|---|
children | Configure
|
class | Configure
|
disabled | Configure
|
id | Configure
|
onClick | Configure
|
onKeyDown | Configure
|
value | Configure
|
Data Type Reference
Expand a card to inspect and copy the exact declaration. The code header identifies its repository file; follow imported or inherited types in the Implementation Source when you need the complete dependency chain. Required-field summaries cover fields declared directly in that type. Source-only helpers and inferred schema outputs describe the local implementation, not additional props you can pass to every component.
Tabs Props
4 declared fieldsTabsPropsTabs.tsx. Referenced types retain their original names; inspect that file for imports and supporting definitions. Inspect the Complete Definition of TabsProps before adapting it.defaultValueTabsContent Props
3 declared fieldsTabsContentPropsTabsContent.tsx. Referenced types retain their original names; inspect that file for imports and supporting definitions. Inspect the Complete Definition of TabsContentProps before adapting it.valueTabsList Props
1 declared fieldTabsListPropsTabsList.tsx. Referenced types retain their original names; inspect that file for imports and supporting definitions. Inspect the Complete Definition of TabsListProps before adapting it.TabsTrigger Props
2 declared fieldsTabsTriggerPropsTabsTrigger.tsx. Referenced types retain their original names; inspect that file for imports and supporting definitions. Inspect the Complete Definition of TabsTriggerProps before adapting it.valueAccessibility
TabsList exposes tablist semantics and orientation. TabsTrigger supplies selected state and its panel relationship; TabsContent is a labeled tabpanel. The trigger implements direction-aware arrow movement and Home/End navigation among enabled tabs.
You have the pieces. Put them into one real interaction, keep its state in one place, and check the result with the content your application will actually show.
Connect the Foundation
Return to Choose and Compose Components to connect this reference to a working screen. Keep global CSS in one entrypoint and import only the components that screen needs.
Build the Surrounding Screen
Find a neighboring interaction in the Component Library, or start with a complete Block. Replace sample content and destinations before refining the layout; a local class change can stay with the composition.
Make the Result Hold Up
Use shared theme roles for changes that belong everywhere. Then review the whole journey: keyboard focus, long labels, narrow screens and a clear way to recover when something fails.
Keep a link to the source and note your intentional changes. Your next edit should begin with a clear decision, not another search.