Skip to content

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-tabs

API Reference

Tabs

PropTypeDescription
asChildbooleanWhen set to true, renders the component as its child element, inheriting the child's styles and behavior.
defaultValueSpecifies 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.
onValueChangefunctionEvent 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

PropTypeDescription
asChildbooleanWhen set to true, renders the component as its child element, inheriting the child's styles and behavior.
loopbooleanWhen true, keyboard navigation will loop from last item to first, and vice versa.

TabsTrigger

PropTypeDescription
asChildbooleanWhen set to true, renders the component as its child element, inheriting the child's styles and behavior.
valuestringRepresents the current value or state of the component, which can be used to bind or track its data over time.
disabledbooleanWhen set to true, disables the component, preventing user interaction or triggering of associated actions.

TabsContent

PropTypeDescription
asChildbooleanWhen set to true, renders the component as its child element, inheriting the child's styles and behavior.
valuestringRepresents the current value or state of the component, which can be used to bind or track its data over time.
forceMountbooleanUsed to force mounting when more control is needed. Useful when controlling animation with React animation libraries. It inherits from.

Keyboard Interactions

KeyDescription
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.