{"slug":"tabs","name":"Tabs","category":"Layout & Navigation","summary":"Switches between panels that share one context.","status":"stable","since":"0.1.0","import":"import { Tabs, TabList, Tab, TabPanel } from '@elluzion/iv-ui';","usage":["`Tabs` owns the value; `TabList` holds `Tab` buttons; `TabPanel` shows matching content.","Bind `value` for controlled state, or set `defaultValue` for an uncontrolled group.","`bordered` wraps the list and panel in one frame."],"props":[{"name":"value","type":"string","default":null,"description":"Selected tab value. Bind with `bind:value`.","required":false,"bindable":true},{"name":"defaultValue","type":"string","default":"''","description":"Selected tab value on first render when uncontrolled.","required":false,"bindable":false},{"name":"size","type":"'sm' | 'md'","default":"'md'","description":"Tab height and padding.","required":false,"bindable":false},{"name":"bordered","type":"boolean","default":"false","description":"Draws a border around the tab list and panel.","required":false,"bindable":false},{"name":"className","type":"string","default":"''","description":"Extra classes merged onto the root element.","required":false,"bindable":false},{"name":"label","type":"string","default":"''","description":"Accessible name for the tab list.","required":false,"bindable":false},{"name":"className","type":"string","default":"''","description":"Extra classes merged onto the root element.","required":false,"bindable":false},{"name":"value","type":"string","default":null,"description":"Unique value matched by a tab panel.","required":true,"bindable":false},{"name":"disabled","type":"boolean","default":"false","description":"Prevents selection and removes the tab from the tab order.","required":false,"bindable":false},{"name":"className","type":"string","default":"''","description":"Extra classes merged onto the root element.","required":false,"bindable":false},{"name":"value","type":"string","default":null,"description":"Value of the tab that controls this panel.","required":true,"bindable":false},{"name":"className","type":"string","default":"''","description":"Extra classes merged onto the root element.","required":false,"bindable":false}],"events":[{"name":"change","type":"(e: CustomEvent<{ value: string }>) => void","default":null,"description":"Called with `{ value }` after a tab is selected.","required":false,"bindable":false}],"snippets":[{"name":"children","type":"Snippet","default":null,"description":"Content rendered inside the component.","required":true,"bindable":false},{"name":"children","type":"Snippet","default":null,"description":"The tab buttons.","required":true,"bindable":false},{"name":"children","type":"Snippet","default":null,"description":"Tab label.","required":true,"bindable":false},{"name":"children","type":"Snippet","default":null,"description":"Panel content.","required":true,"bindable":false}],"types":[],"manual":[],"tokens":["--iv_border","--iv_radius","--iv_spacing-xs","--iv_cursor","--iv_disabled-opacity","--iv_ease-out","--iv_font-ui","--iv_foreground","--iv_foreground-dim","--iv_outline-width","--iv_radius-sm","--iv_reverse-bg","--iv_reverse-fg","--iv_spacing-md","--iv_spacing-sm","--iv_text-body","--iv_text-btn-sm","--iv_transition-fast","--iv_leading-base","--iv_outline-offset","--iv_spacing-xl"],"cssHooks":["iv-bordered","iv-tabs","iv-tab-list","iv-active","iv-md","iv-sm","iv-tab","iv-tab-panel"],"accessibility":{"keyboard":[["Tab","Moves focus into the tab list."],["Arrow left / right","Moves to the previous or next tab."],["Home / End","Moves to the first or last tab."],["Enter / Space","Selects the focused tab."]],"notes":["The list uses `role=\"tablist\"`; each tab controls a panel through `aria-controls`.","Only the active tab is in the tab order; arrow keys provide the rest of the navigation.","Panels use `role=\"tabpanel\"` and are labelled by their tab."]},"related":[{"title":"Accordion","summary":"A stack of collapsible sections; one or several can be open.","url":"/components/accordion","kind":"Component"},{"title":"ToggleGroup","summary":"A row of toggles with single or multiple selection.","url":"/components/toggle-group","kind":"Component"},{"title":"ButtonGroup","summary":"Joins related buttons into one segmented control.","url":"/components/button-group","kind":"Component"},{"title":"Card","summary":"A bordered surface for grouped content and actions.","url":"/components/card","kind":"Component"}],"examples":[{"id":"basic","title":"Basic","description":"An uncontrolled group with the first tab selected.","code":"<script lang=\"ts\">\n\timport { Tab, TabList, TabPanel, Tabs } from '@elluzion/iv-ui';\n</script>\n\n<Tabs defaultValue=\"overview\">\n\t<TabList label=\"Project sections\">\n\t\t<Tab value=\"overview\">Overview</Tab>\n\t\t<Tab value=\"deploys\">Deployments</Tab>\n\t\t<Tab value=\"settings\">Settings</Tab>\n\t</TabList>\n\t<TabPanel value=\"overview\">Runtime, regions, and the current release.</TabPanel>\n\t<TabPanel value=\"deploys\">Every run, with the commit and the duration.</TabPanel>\n\t<TabPanel value=\"settings\">Access, retention, and the deploy key.</TabPanel>\n</Tabs>"},{"id":"bordered","title":"Bordered","description":"`bordered` frames the list and panel as one surface.","code":"<script lang=\"ts\">\n\timport { Tab, TabList, TabPanel, Tabs } from '@elluzion/iv-ui';\n</script>\n\n<Tabs defaultValue=\"logs\" bordered>\n\t<TabList label=\"Output\">\n\t\t<Tab value=\"logs\">Logs</Tab>\n\t\t<Tab value=\"trace\">Trace</Tab>\n\t</TabList>\n\t<TabPanel value=\"logs\">12:04:18 deploy started</TabPanel>\n\t<TabPanel value=\"trace\">build → test → publish (4.2s)</TabPanel>\n</Tabs>"},{"id":"sizes","title":"Sizes","description":"`sm` and `md` tab heights.","code":"<script lang=\"ts\">\n\timport { Tab, TabList, TabPanel, Tabs } from '@elluzion/iv-ui';\n</script>\n\n<div class=\"stack\">\n\t<Tabs defaultValue=\"one\" size=\"sm\">\n\t\t<TabList label=\"Small tabs\">\n\t\t\t<Tab value=\"one\">One</Tab>\n\t\t\t<Tab value=\"two\">Two</Tab>\n\t\t</TabList>\n\t\t<TabPanel value=\"one\">Small tab content.</TabPanel>\n\t\t<TabPanel value=\"two\">Second panel.</TabPanel>\n\t</Tabs>\n\t<Tabs defaultValue=\"one\">\n\t\t<TabList label=\"Medium tabs\">\n\t\t\t<Tab value=\"one\">One</Tab>\n\t\t\t<Tab value=\"two\">Two</Tab>\n\t\t</TabList>\n\t\t<TabPanel value=\"one\">Medium tab content.</TabPanel>\n\t\t<TabPanel value=\"two\">Second panel.</TabPanel>\n\t</Tabs>\n</div>\n\n<style>\n\t.stack {\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\tgap: var(--iv_spacing-xl);\n\t}\n</style>"}],"markdown":"/components/tabs.md","page":"/components/tabs"}