WritedocsWritedocs

View

Use View when a page has the same content in several versions, like one per programming language. Every distinct title on the page becomes an option in a switcher under the page title, and only the chosen version shows:

<View title="JavaScript" icon="js">
  ## Install the SDK

  npm install example-sdk
</View>

<View title="Python" icon="python">
  ## Install the SDK

  pip install example-sdk
</View>

A page can have several Views with the same title - one switcher controls all of them, and content outside any View always shows.

  • The table of contents only lists the headings in the version that’s showing.
  • The reader’s choice is remembered, so it carries over to other pages that have the same titles.
  • A link to a heading inside a hidden version switches to that version.

Use Tabs instead when only one section of a page differs, or CodeGroup when only a code sample does.

View props

titlestringrequired

The version’s name in the switcher. Views with the same title show and hide together.

iconstring

Shown next to the title in the switcher. Any icon string - see Icons.