Components
Organize content into interactive tabbed sections
The <Tabs> component organizes content into switchable sections. Perfect for showing platform-specific instructions, code examples in different languages, or alternative approaches.
JavaScript is a versatile programming language.
TypeScript adds static typing to JavaScript.
Python is known for its readability and simplicity.
<Tabs>
<Tab title="JavaScript">
JavaScript is a versatile programming language.
</Tab>
<Tab title="TypeScript">TypeScript adds static typing to JavaScript.</Tab>
<Tab title="Python">
Python is known for its readability and simplicity.
</Tab>
</Tabs>Common use case for installation instructions:
npm install @acme/sdkyarn add @acme/sdkpnpm add @acme/sdkbun add @acme/sdk<Tabs>
<Tab title="npm">
```bash
npm install @acme/sdk
```
</Tab>
<Tab title="yarn">```bash yarn add @acme/sdk ```</Tab>
<Tab title="pnpm">```bash pnpm add @acme/sdk ```</Tab>
<Tab title="bun">
```bash
bun add @acme/sdk
```
</Tab>
</Tabs>Show different instructions based on operating system:
Install using Homebrew:
brew install acme-cliOr download the .dmg installer from our website.
Download the .exe installer from our website, or use Chocolatey:
choco install acme-cliInstall using your package manager:
Ubuntu/Debian:
sudo apt install acme-cliFedora:
sudo dnf install acme-cli<Tabs>
<Tab title="macOS">
Install using Homebrew:
```bash
brew install acme-cli
```
Or download the `.dmg` installer from our website.
</Tab>
<Tab title="Windows">
Download the `.exe` installer from our website, or use Chocolatey:
```powershell
choco install acme-cli
```
</Tab>
<Tab title="Linux">
Install using your package manager:
**Ubuntu/Debian:**
```bash
sudo apt install acme-cli
```
**Fedora:**
```bash
sudo dnf install acme-cli
```
</Tab>
</Tabs>Perfect for showing the same functionality in different languages:
curl -X POST https://api.example.com/users \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"name":"John Doe","email":"john@example.com"}'const response = await fetch('https://api.example.com/users', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: 'John Doe',
email: 'john@example.com'
})
});import requests
response = requests.post(
'https://api.example.com/users',
headers={
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
json={
'name': 'John Doe',
'email': 'john@example.com'
}
)<Tabs>
<Tab title="cURL">
```bash
curl -X POST https://api.example.com/users \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"name":"John Doe","email":"john@example.com"}'
```
</Tab>
<Tab title="JavaScript">
```javascript
const response = await fetch('https://api.example.com/users', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: 'John Doe',
email: 'john@example.com'
})
});
```
</Tab>
<Tab title="Python">
```python
import requests
response = requests.post(
'https://api.example.com/users',
headers={
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
json={
'name': 'John Doe',
'email': 'john@example.com'
}
)
```
</Tab>
</Tabs>Tabs support complex content including multiple components:
Get up and running in minutes:
npm install @acme/sdkimport { init } from '@acme/sdk';
init({ apiKey: 'YOUR_KEY' });For production environments:
import { init } from '@acme/sdk';
init({
apiKey: process.env.ACME_API_KEY,
environment: 'production',
timeout: 5000,
retries: 3
});Always use environment variables for API keys.
<Tabs>
<Tab title="Basic Setup">
## Quick Start
Get up and running in minutes:
<Steps>
<Step title="Install">
```bash
npm install @acme/sdk
```
</Step>
<Step title="Initialize">
```javascript
import { init } from '@acme/sdk';
init({ apiKey: 'YOUR_KEY' });
```
</Step>
</Steps>
</Tab>
<Tab title="Advanced Setup">
## Custom Configuration
For production environments:
```javascript
import { init } from '@acme/sdk';
init({
apiKey: process.env.ACME_API_KEY,
environment: 'production',
timeout: 5000,
retries: 3
});
```
<Callout status="warning">
Always use environment variables for API keys.
</Callout>
</Tab>
</Tabs>Control which tab is active by default:
JavaScript will not be shown first.
TypeScript will be shown first (default).
Python is available but not default.
<Tabs defaultValue="TypeScript">
<Tab title="JavaScript">
JavaScript will not be shown first.
</Tab>
<Tab title="TypeScript">TypeScript will be shown first (default).</Tab>
<Tab title="Python">
Python is available but not default.
</Tab>
</Tabs>The defaultValue must match a tab's title exactly (case-sensitive).
The <Tab> components to render. Only direct <Tab> children are processed.
<Tabs>
<Tab title="First">...</Tab>
<Tab title="Second">...</Tab>
</Tabs>The title of the tab to show by default. If not specified, the first tab is active.
<Tabs defaultValue="TypeScript">
<Tab title="JavaScript">...</Tab>
<Tab title="TypeScript">...</Tab>
</Tabs>Color palette for active tab indicators. Defaults to site's colorPalette.
<Tabs colorPalette="purple">...</Tabs>The label displayed in the tab selector.
<Tab title="JavaScript">JavaScript content here</Tab>The content shown when this tab is active. Supports full Markdown.
<Tab title="Example">You can use **bold**, *italic*, and [links](/docs).</Tab>Next, learn about the ParamField Component for documenting parameters.