Tabs
Loading example…
To sync the active tab with a search param, use the controlled pattern:
value={param} + onValueChange={(v) => updateParam(v)}.
Import
Section titled “Import”import { Tabs } from "@jcsoftdev/ui/navigation";Single-component entry points tree-shake to just this component: @jcsoftdev/ui/navigation/tabs.
export const Default: Story = {};Source of the Storybook story.
| Prop | Type | Default | Description |
|---|---|---|---|
value |
string |
Controlled active tab. | |
defaultValue |
string |
Initial active tab when uncontrolled. | |
onValueChange |
((value: string) => void) |
||
orientation |
"horizontal" | "vertical" |
"horizontal" |
|
dir |
"ltr" | "rtl" |
"ltr" |
|
activationMode |
"automatic" | "manual" |
"automatic" |
automatic activates a tab on focus; manual waits for Enter, Space or a click. |
* marks a required prop.
It also accepts the native props of the element or primitive it renders (for example className, id, aria-* and event handlers).
Storybook stories
Section titled “Storybook stories”Source
Section titled “Source”packages/ui/src/navigation/tabs/tabs.tsx