Skip to content

Implement reusable Language Tab Components #254

@lachieh

Description

@lachieh

We use the <Tabs> and <Tab> components to sync the language selected by the user, however, this requires maintaining the same id everywhere the components are used. It would be helpful to be able to use a component that handles the props for us.

For example:

<LangTabs>
  <LangTab lang="rust">...</LangTab>
  <LangTab lang="go">...</LangTab>
  ...etc
</LangTabs>

Alternatively, each language could be a specific component. This would enable specific API for props (i.e. marking a RustTab as a component vs module, or marking a GoTab as the "tiny" or main syntax)

<LangTabs>
  <RustTab>...</RustTab>
  <GoTab>...</GoTab>
  ...etc
</LangTabs>

It would also be useful to not have to import these components every time they are used in an mdx file.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions