open-vault/website/components/tabs
Jeff Escalante 8eed94b072
🌷 Docs Website Maintenance (#8985)
* website maintenance round
* improve docs, revert bug workaround as it was fixed
* boost memory
* remove unnecessary code
2020-05-21 13:18:17 -04:00
..
README.md 🌷 Docs Website Maintenance (#8985) 2020-05-21 13:18:17 -04:00
index.jsx 🌷 Docs Website Maintenance (#8985) 2020-05-21 13:18:17 -04:00
style.css 🌷 Docs Website Maintenance (#8985) 2020-05-21 13:18:17 -04:00

README.md

Tabs Component

An MDX-compatible Tabs component

This React component renders tabbed content.

Usage

  • Use the <Tabs> tag in your markdown file to begin a tabbed content section.
  • Use the <Tab> tag with a heading prop to separate your markdown

Important

A line must be skipped between the <Tab> and your markdown (for both above and below said markdown). This is a limitation of MDX also pointed out by the Docusaurus folks 🔗

Example

<Tabs>
<Tab heading="CLI command">
             <!-- Intentionally skipped line.. -->
### Content
            <!-- Intentionally skipped line.. -->
</Tab>
<Tab heading="API call using cURL">

### Content

</Tab>
</Tabs>

Component Props

<Tabs> can be provided any arbitrary children so long as the heading prop is present the React or HTML tag used to wrap markdown, that said, we provide the <Tab> component to separate your tab content without rendering extra, unnecessary markup.

This works:

<Tabs>
<Tab heading="CLI command">

### Content

</Tab>
....
</Tabs>

This does not work:

<Tabs>
<Tab> <!-- missing the `heading` prop to provide a tab heading -->

### Content

</Tab>
....
</Tabs>