@@ -5,38 +5,43 @@ description: Tabbed content UI for grouped alternatives.
55
66# Tabs
77
8- ` Tabs ` exports ` TabPanels ` for rendering tab groups .
8+ ` TabPanels ` renders a tab group. Each ` Tab ` child represents one tab, with its ` title ` displayed as the tab button label. Tab content can be any HTML or Markdown .
99
10- ## Props (` TabPanels ` )
10+ ## Props
11+
12+ ### ` TabPanels `
1113
1214| Prop | Type | Required | Description |
1315| --- | --- | --- | --- |
14- | ` tabs ` | ` Array<{ id: string, label: string, content: ReactNode }> ` | Yes | Tab definitions. |
16+ | ` children ` | ` Tab ` elements | Yes | One or more ` Tab ` components. |
17+
18+ ### ` Tab `
19+
20+ | Prop | Type | Required | Description |
21+ | --- | --- | --- | --- |
22+ | ` title ` | ` string ` | Yes | Label shown on the tab button. |
23+ | ` children ` | ` ReactNode ` | Yes | Content rendered when the tab is active. |
1524
1625## Live examples
1726
18- <TabPanels
19- tabs = { [
20- { id: ' js' , label: ' JavaScript' , content: ' npm run dev' },
21- { id: ' pnpm' , label: ' pnpm' , content: ' pnpm dev' },
22- { id: ' bun' , label: ' bun' , content: ' bun run dev' },
23- ]}
24- />
25-
26- <TabPanels
27- tabs = { [
28- { id: ' docs' , label: ' Docs' , content: ' Markdown + MDX content pages.' },
29- { id: ' config' , label: ' Config' , content: ' JSON files for navigation and layout behavior.' },
30- ]}
31- />
27+ <TabPanels >
28+ <Tab title = " JavaScript" >npm run dev</Tab >
29+ <Tab title = " pnpm" >pnpm dev</Tab >
30+ <Tab title = " Bun" >bun run dev</Tab >
31+ </TabPanels >
32+
33+ <TabPanels >
34+ <Tab title = " Docs" >Markdown + MDX content pages.</Tab >
35+ <Tab title = " Config" >JSON files for navigation and layout behavior.</Tab >
36+ </TabPanels >
3237
3338## Code
3439
3540``` mdx
36- <TabPanels
37- tabs = { [
38- { id: ' js' , label: ' JavaScript' , content: ' npm run dev' },
39- { id: ' pnpm' , label: ' pnpm' , content: ' pnpm dev' },
40- ]}
41- />
41+ <TabPanels >
42+ <Tab title = " JavaScript" >npm run dev</Tab >
43+ <Tab title = " pnpm" >pnpm dev</Tab >
44+ <Tab title = " Bun" >bun run dev</Tab >
45+ </TabPanels >
4246```
47+
0 commit comments