Tabs/Tab
Tabs and Tab switch between multiple content panes.
Usage
Tab 1 content
index.mdx
Code blocks
src/index.mjs
index.mdx
Group synchronization
Use the same groupId to synchronize the active tab across multiple Tabs.
npm install rspress
npm run dev
index.mdx
Custom labels
Use label on each Tab to render custom tab labels.
GitHub repository settings
index.mdx
Separate labels and content
Use values to define tab labels separately from panel content. Each item provides a value, and the matching <Tab value="..."> supplies the content. Use defaultValue to preselect a tab by value.
This is an apple 🍎
index.mdx
Props
label accepts any renderable React node, so it can include icons or custom markup. Use defaultIndex to preselect a tab by index, or defaultValue to preselect a tab by value; groupId syncs selection across multiple Tabs; tabPosition sets list alignment.