Tabs
A set of layered sections of content that are displayed one at a time. Perfect for organizing related content into separate views.
Import
import { Tabs, TabsList, TabsTrigger, TabsContent } from "@sparrowengg/twigs-react";Usage
const TabsExample = () => {
return (
<Tabs defaultValue="account">
<TabsList aria-label="Account settings">
<TabsTrigger value="account">Account</TabsTrigger>
<TabsTrigger value="password">Password</TabsTrigger>
</TabsList>
<TabsContent value="account">
<Box css={{ padding: "$6" }}>
<Text>Make changes to your account here.</Text>
</Box>
</TabsContent>
<TabsContent value="password">
<Box css={{ padding: "$6" }}>
<Text>Change your password here.</Text>
</Box>
</TabsContent>
</Tabs>
);
};Props
Tabs
| Prop | Type | Default |
|---|---|---|
defaultValue? | string | - |
value? | string | - |
onValueChange? | (value: string) => void | - |
orientation? | 'horizontal' | 'vertical' | 'horizontal' |
dir? | 'ltr' | 'rtl' | - |
activationMode? | 'automatic' | 'manual' | 'automatic' |
css? | object | - |
TabsList
| Prop | Type | Default |
|---|---|---|
loop? | boolean | true |
children? | ReactNode | - |
TabsTrigger
| Prop | Type | Default |
|---|---|---|
value? | string | - |
disabled? | boolean | false |
children? | ReactNode | - |
TabsContent
| Prop | Type | Default |
|---|---|---|
value? | string | - |
forceMount? | boolean | - |
children? | ReactNode | - |
Data Attributes
These props are used for the conditional rendering of the components
Applicable - Tabs, TabsList
| Prop | Type | Default |
|---|---|---|
[data-orientation]? | 'vertical' | 'horizontal' | - |
Applicable - TabsTrigger
| Prop | Type | Default |
|---|---|---|
[data-state]? | 'active' | 'inactive' | - |
[data-disabled]? | boolean | - |
[data-orientation]? | 'vertical' | 'horizontal' | - |
Applicable - TabsContent
| Prop | Type | Default |
|---|---|---|
[data-state]? | 'active' | 'inactive' | - |
[data-orientation]? | 'vertical' | 'horizontal' | - |
Stepper
A multi-step navigation component that guides users through a sequence of related actions. Perfect for forms, wizards and complex workflows.
Circle Loader
Animated circular loading indicator with customizable sizes and colors. Perfect for showing loading states in buttons, forms, and other UI elements.