Tabs (:::tabs
, :::tab-item
)
To use tabs, add :::tab-item
children nested inside :::tabs
.
Each :::tab-item
directive must specify its tab label in square brackets (e.g. :::tab-item[JavaScript]
). The tab label is displayed (with auto-capitalization), is added to the URL as a query parameter when the tab gets selected, and is used for tab selection syncing when multiple :::tabs
directives are present on the page.
Example:
Markdown
::::tabs
:::tab-item[JavaScript]
```js
console.log('hello world');
```
:::
:::tab-item[yaml]
```yaml
note: Programming language tab labels are auto-capitalized.
```
:::
:::tab-item[arbitrary]
Arbitrary **content** _is_ supported.
:::
::::
Output:
- JavaScript
- YAML
- Arbitrary
JavaScript
console.log('hello world');
YAML
note: Programming language tab labels are auto-capitalized.
Arbitrary content is supported.