Tabs
The Tabs component organizes content into separate tabs that users can switch between. Each tab can contain different types of content like examples, code snippets, or documentation sections.
First Tab
Second Tab
Third Tab
☝️ Welcome to the content that you can only see inside the first Tab.
Properties
The title displayed in the tab header
The language associated with the code block. Any arbitrary string may be used.
When specified, enables global language synchronization across all tabs and code blocks with the same language value.
The content to be displayed when the tab is selected. Can include text, markdown, and components.
Language synchronization
Multiple Tabs
with a language
property automatically synchronize. This means
when a user selects a tab with a specific language, all other tabs across your
documentation site with the same language will automatically sync and switch to
match. Language preferences are stored in client-side local storage and persist
across browser sessions.
In the example below, choosing a language in either set of tabs will automatically update both sets to match:
TypeScript
Python
Java
TypeScript
Python
Java
Tabs and CodeBlocks integration
Language-enabled Tabs
automatically synchronize with CodeBlocks
in that same language.
Tabs without the language property
Tabs without the language
property don’t stay in sync with other tabs on your site. In the below example, choosing a language in
either set of tabs doesn’t affect the other set of tabs: