Animated, accessible tab component with keyboard navigation and an animated indicator.
Made by raouf.codesOverview
The Tabs component provides a small, composable, and accessible tab system with first-class keyboard support and smooth motion.
Subcomponents & hooks:
Tabs— root component (state, ids, keyboard logic)Tabs.List— tablist containerTabs.Trigger— interactive tab buttonTabs.Indicator— animated underline / selection indicatorTabs.Content— layout wrapper for panelsTabs.Panel— individual animated paneluseTabs()— advanced hook for custom integrations
Advanced users can import useTabs() from the registry context for id helpers and keyboard/register callbacks.
Installation
Usage
It can be used uncontrolled for simplicity, or controlled when you need external state management.
Basic (uncontrolled)
Controlled
Using useTabs() inside a custom panel
API Reference
Tabs (root)
| Prop | Type | Default |
|---|---|---|
value? | string | - |
defaultValue? | string | - |
onValueChange? | function | - |
activation? | enum | "manual" |
ltr? | boolean | true |
intent? | enum | "primary" |
styling? | enum | "underline" |
visuals? | enum | "classic" |
size? | enum | "md" |
shape? | enum | "rounded" |
className? | string | - |
...props? | ComponentProps<"div"> | - |
Tabs.List
| Prop | Type | Default |
|---|---|---|
className? | string | - |
...props? | ComponentProps<"div"> | - |
Tabs.Trigger
Azemmur API Reference - Button Primitive
| Prop | Type | Default |
|---|---|---|
value | string | - |
triggerClassName? | string | - |
indicatorClassName? | string | - |
...props? | HTMLMotionProps<"button"> | - |
Tabs.Content
| Prop | Type | Default |
|---|---|---|
className? | string | - |
...props? | ComponentProps<"div"> | - |
Tabs.Panel
| Prop | Type | Default |
|---|---|---|
value | string | - |
className? | string | - |
...props? | ComponentProps<typeof motion.div> | - |
Tabs.Indicator
| Prop | Type | Default |
|---|---|---|
intent? | enum | "primary" |
styling? | enum | "underline" |
visuals? | enum | "classic" |
shape? | enum | "rounded" |
...props? | ComponentProps<typeof motion.div> | - |
useTabs() hook
Variants
Visual variants are powered by tabs-variants and applied consistently across the component:
intent— semantic intent (primary / secondary / accent)styling— trigger & indicator stylevisuals— surface / background treatmentsize— spacing & typographyshape— border radius
For more details, refer to the tables above.
Accessibility
Tabs.Listrendersrole="tablist"witharia-orientation.Tabs.Triggerusesrole="tab",aria-selected, andaria-controls.Tabs.Panelusesrole="tabpanel",id, andaria-labelledby.- Ids are generated via
useTabs()helpers for consistency.
Keyboard support
ArrowRight/ArrowLeft— move focus between tabs (respectsltr)Home/End— jump to first / last tab'auto'vs'manual'activation controls when selection changes
Notes
Tabsmanages focus and selection internally unless controlled viavalue.- This component exposes a stable public API. Lower-level primitives (auto-height contents, advanced layout helpers) live in the shared UI package and are intentionally not part of this surface.
Built by raouf.codes. The source code is available on GitHub.
Last updated: 1/28/2026