Tabs
Pass items as { value, label, content, icon?, disabled? }. The machine manages
focus, arrow keys, selection, and panels.
import { Tabs } from '@manti-ui/react'; const items = [ { value: 'dough', label: 'Dough', content: 'Flour, egg, water, and a pinch of salt.', }, { value: 'filling', label: 'Filling', content: 'Beef or lamb, grated onion, and spice.', }, { value: 'sauce', label: 'Sauce', content: 'Garlic yogurt under warm paprika butter.', }, ]; export default function TabsBasic() { return ( <div className="w-full max-w-[calc(var(--manti-space-16)*8)]"> <Tabs items={items} /> </div> ); }
Variants
Use line, pill, or soft.
Flour, egg, water, and a pinch of salt.
Beef or lamb, grated onion, and spice.
Garlic yogurt under warm paprika butter.
Flour, egg, water, and a pinch of salt.
Beef or lamb, grated onion, and spice.
Garlic yogurt under warm paprika butter.
Flour, egg, water, and a pinch of salt.
Beef or lamb, grated onion, and spice.
Garlic yogurt under warm paprika butter.
Sizes
Flour, egg, water, and a pinch of salt.
Beef or lamb, grated onion, and spice.
Garlic yogurt under warm paprika butter.
Flour, egg, water, and a pinch of salt.
Beef or lamb, grated onion, and spice.
Garlic yogurt under warm paprika butter.
API
| Prop | Type | Default | Description |
|---|---|---|---|
items | TabItem[] | — | Each item: value, label, content, optional icon/disabled. |
variant | 'line' | 'pill' | 'soft' | 'line' | Visual style. |
size | 'sm' | 'md' | 'md' | Control size. `sm` tightens the triggers for compact, embedded usage. |
value | string | — | Controlled selected value. |
defaultValue | string | — | Initial selection (defaults to the first item). |
onValueChange | (value: string) => void | — | Called when the selected value changes. |
orientation | 'horizontal' | 'vertical' | — | Layout direction. |
Styling
Anatomy
| Part | Selector | Description |
|---|---|---|
root | [data-scope="tabs"][data-part="root"] | The tabs container. |
list | [data-scope="tabs"][data-part="list"] | The trigger row. |
trigger | [data-scope="tabs"][data-part="trigger"] | A tab button. |
indicator | [data-scope="tabs"][data-part="indicator"] | The sliding active marker. |
content | [data-scope="tabs"][data-part="content"] | A tab panel. |
Tokens
| Token | Controls |
|---|---|
--manti-tabs-gap | gap |
--manti-tabs-list-gap | list gap |
--manti-tabs-track-padding | track padding |
--manti-tabs-track-radius | track radius |
--manti-tabs-track-radius-vertical | track radius vertical |
--manti-tabs-trigger-gap | trigger gap |
--manti-tabs-trigger-padding-y | trigger padding y |
--manti-tabs-trigger-padding-x | trigger padding x |
--manti-tabs-trigger-font-size | trigger font size |
--manti-tabs-trigger-radius | trigger radius |
--manti-tabs-indicator-size | indicator size |
--manti-tabs-content-radius | content radius |
Last updated