Primitives
Tabs
Underline, pill, solid, enclosed — one API, the indicator slides.
underline
312 sessions today.
pill
312 sessions today.
solid
312 sessions today.
enclosed
312 sessions today.
tabs.tsx
"use client";
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@waveinno/ui";
export default function TabsDemo() {
const tabs = (
<>
<TabsTrigger value="overview">Overview</TabsTrigger>
<TabsTrigger value="sessions" count={312}>
Sessions
</TabsTrigger>
<TabsTrigger value="rates">Rates</TabsTrigger>
</>
);
return (
<div className="space-y-6">
{(["underline", "pill", "solid", "enclosed"] as const).map((variant) => (
<div key={variant}>
<p className="mb-2 text-[11.5px] text-muted">{variant}</p>
<Tabs defaultValue="sessions" className="max-w-xl">
<TabsList variant={variant} className={variant === "pill" || variant === "solid" ? "w-fit" : undefined}>
{tabs}
</TabsList>
<TabsContent value="overview" className="pt-3 text-sm text-body">
Overview content.
</TabsContent>
<TabsContent value="sessions" className="pt-3 text-sm text-body">
312 sessions today.
</TabsContent>
<TabsContent value="rates" className="pt-3 text-sm text-body">
Rates content.
</TabsContent>
</Tabs>
</div>
))}
</div>
);
}Import#
Everything comes from the package root. The example above uses:
your-component.tsx
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@waveinno/ui";Props#
Read from the source of this version, so they match the code exactly.
<TabsContent>
src/components/ui/tabs.tsxAlso takes ComponentPropsWithoutRef<typeof TabsPrimitive.Content> (passed through).
<TabsList>
src/components/ui/tabs.tsx| Prop | Type | Default | Description |
|---|---|---|---|
variant | "underline" | "pill" | "solid" | "enclosed" | "underline" |
Also takes ComponentPropsWithoutRef<typeof TabsPrimitive.List>.
<TabsTrigger>
src/components/ui/tabs.tsx| Prop | Type | Default | Description |
|---|---|---|---|
count | number | — |
Also takes ComponentPropsWithoutRef<typeof TabsPrimitive.Trigger>.
Install#
If the project does not have the package yet, add it, then follow the setup for Next.js or Vite once.
$ npm install @waveinno/ui