mirror of
https://github.com/facebook/docusaurus.git
synced 2025-08-02 16:29:47 +02:00
refactor(v2): render all tab panels at once (#3706)
* refactor(v2): render all tab panels at once * Add ability to choose way to load tabs
This commit is contained in:
parent
498f8a0f27
commit
8c9f9487d6
4 changed files with 49 additions and 15 deletions
|
@ -296,6 +296,12 @@ And you will get the following:
|
|||
<TabItem value="banana">This is a banana 🍌</TabItem>
|
||||
</Tabs>
|
||||
|
||||
:::info
|
||||
|
||||
By default, tabs are rendered eagerly, but it is possible to load them lazily by passing the `lazy` prop to the `Tabs` component.
|
||||
|
||||
:::
|
||||
|
||||
### Syncing tab choices
|
||||
|
||||
You may want choices of the same kind of tabs to sync with each other. For example, you might want to provide different instructions for users on Windows vs users on macOS, and you want to changing all OS-specific instructions tabs in one click. To achieve that, you can give all related tabs the same `groupId` prop. Note that doing this will persist the choice in `localStorage` and all `<Tab>` instances with the same `groupId` will update automatically when the value of one of them is changed. Not that `groupID` are globally-namespaced.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue