Tabs
A set of layered sections of content—known as tab panels—that are displayed one at a time.
Account
Make changes to your account here. Click save when you're done.
Installation
npm i @huin-core/react-tabsAPI Reference
Tabs
| Prop | Type | Description |
|---|---|---|
| asChild | boolean | When set to true, renders the component as its child element, inheriting the child's styles and behavior. |
| defaultValue | — | Specifies the initial value of the component when it is first rendered, before any user interaction or dynamic updates. |
| value | "account" | "password" | Represents the current value or state of the component, which can be used to bind or track its data over time. |
| onValueChange | function | Event handler called when the value changes. |
| orientation | "vertical" | "horizontal" | Specifies the direction or layout of the component, determining whether it is displayed vertically or horizontally. |
| dir | "ltr" | "rtl" | The reading direction. If omitted, inherits globally from DirectionProvider or assumes LTR (left-to-right) reading mode. |
| activationMode | "automatic" | "manual" | When automatic, tabs are activated when receiving focus. When manual, tabs are activated when clicked. |
TabsList
| Prop | Type | Description |
|---|---|---|
| asChild | boolean | When set to true, renders the component as its child element, inheriting the child's styles and behavior. |
| loop | boolean | When true, keyboard navigation will loop from last item to first, and vice versa. |
TabsTrigger
| Prop | Type | Description |
|---|---|---|
| asChild | boolean | When set to true, renders the component as its child element, inheriting the child's styles and behavior. |
| value | string | Represents the current value or state of the component, which can be used to bind or track its data over time. |
| disabled | boolean | When set to true, disables the component, preventing user interaction or triggering of associated actions. |
TabsContent
| Prop | Type | Description |
|---|---|---|
| asChild | boolean | When set to true, renders the component as its child element, inheriting the child's styles and behavior. |
| value | string | Represents the current value or state of the component, which can be used to bind or track its data over time. |
| forceMount | boolean | Used to force mounting when more control is needed. Useful when controlling animation with React animation libraries. It inherits from. |
Keyboard Interactions
| Key | Description |
|---|---|
Tab | Moves focus to the active trigger, then into the panel. |
ArrowRight | Moves to and activates the next tab. |
ArrowLeft | Moves to and activates the previous tab. |
Home | Moves to and activates the first tab. |
End | Moves to and activates the last tab. |