Skip to main content

Tabs

Usage

عنوان ۱
عنوان ۲
عنوان ۳
import Tabs from "@repo/ui/Tabs";
import { useState } from "react";

const [value, setValue] = useState(1);

<Tabs value={value} onChange={(value) => setValue(value)}>
<Tabs.Item>عنوان ۱</Tabs.Item>
<Tabs.Item>عنوان ۲</Tabs.Item>
<Tabs.Item>عنوان ۳</Tabs.Item>
</Tabs>;

Installation

npx the-dig@latest add Tabs

Props

value is the zero-based index of the active direct Tabs.Item child. The parent injects each item’s active state and click handler. Add tablist/tab/tabpanel roles and keyboard behavior in the consuming wrapper; the base component currently renders clickable div elements.

Tabs component

PropTypeDefault
value *number-
onChange *(value: number) => void-
childrenReactNode-
classNamestring-