Copy to clipboard
Make changes to your account here.
Change your password here.
Installation
Copy to clipboard
npx bearnie add tabs
npx bearnie add tabs
bunx bearnie add tabs
bunx bearnie add tabs
pnpm dlx bearnie add tabs
pnpm dlx bearnie add tabs
yarn dlx bearnie add tabs
yarn dlx bearnie add tabs
Copy to clipboard
import Tabs from "@/components/ui/tabs/Tabs.astro";
import TabsList from "@/components/ui/tabs/TabsList.astro";
import TabsTrigger from "@/components/ui/tabs/TabsTrigger.astro";
import TabsContent from "@/components/ui/tabs/TabsContent.astro";
Usage
import {
Tabs,
TabsList,
TabsTrigger,
TabsContent,
} from "@/components/ui/tabs"
<Tabs defaultValue="tab1">
<TabsList>
<TabsTrigger value="tab1">Tab 1</TabsTrigger>
<TabsTrigger value="tab2">Tab 2</TabsTrigger>
</TabsList>
<TabsContent value="tab1">Content 1</TabsContent>
<TabsContent value="tab2">Content 2</TabsContent>
</Tabs>
Examples
Default
Copy to clipboard
Overview content here.
Analytics content here.
Reports content here.
Vertical
Copy to clipboard
General settings and preferences.
Security and privacy options.
Notification preferences.
With cards
Copy to clipboard
Account
Make changes to your account here.
Password
Change your password here.
Anatomy
Tabs- The root container that manages stateTabsList- Container for tab triggersTabsTrigger- Individual tab buttonsTabsContent- Content panels for each tab
Props
Tabs
| Prop | Type | Default | Description |
|---|---|---|---|
| defaultValue | string | - | Initially active tab value |
| orientation | horizontal | vertical | horizontal | Tab layout direction |
| class | string | - | Additional CSS classes |
TabsTrigger
| Prop | Type | Default | Description |
|---|---|---|---|
| value | string | required | Unique identifier for the tab |
| class | string | - | Additional CSS classes |
TabsContent
| Prop | Type | Default | Description |
|---|---|---|---|
| value | string | required | Matches the trigger value |
| class | string | - | Additional CSS classes |