Component reference
Tabs
Horizontal tabs with automatic keyboard activation.
Preview
Project context
Arrow keys and Home / End move between enabled tabs and skip disabled items; input drafts survive leaving and coming back. The controlled example below shows a selection confirmed by the caller.
render: () => {
const selected = signal("overview");
return (
<Measure width="content">
<Stack gap="relaxed">
<Tabs
id="project-tabs"
label="Project views"
items={[
{
value: "overview",
label: "Overview",
content: <p>Website redesign · Organizing the pages to deliver this week.</p>,
},
{ value: "locked", label: "Permissions", disabled: true, content: "Admins only" },
{
value: "notes",
label: "Work notes",
content: <Input aria-label="Work draft" placeholder="Write down what to do next" />,
},
{
value: "files",
label: "Files",
content: <p>design-notes.md · Local example file</p>,
},
]}
/>
<Tabs
id="controlled-tabs"
label="Controlled views"
value={selected}
onValueChange={(value) => {
selected.value = value;
}}
items={[
{
value: "overview",
label: "Summary",
content: <p>The caller stores the selection.</p>,
},
{
value: "details",
label: "Details",
content: <p>Switched to the detailed record.</p>,
},
]}
/>
</Stack>
</Measure>
);
}Installation
bun add meowtail
Usage
import { Tabs } from "meowtail";API reference
Items are fixed for the mount, and panels stay mounted to preserve drafts.
Props
| Prop | Type | Default |
|---|---|---|
idRequired | string | – |
labelRequired | string | – |
itemsRequired | readonly TabItem[] | – |
value | MaybeSignal<string> | – |
defaultValue | string | – |
onValueChange | (value: string) => void | – |
Also takes className, children and the attributes and events of its root element.
DOM parts
rootlistindicatortabpanel
Registry
The component is registered as tabs in the meowtail component registry.