Skip to main content
Mintlify

Search documentation

Type to search this documentation.

On this pageOverview

View

Use the view component to create switchable content panels for different programming languages, frameworks, or configuration alternatives.

Use the View component to create content that changes based on the selected view in a multi-view dropdown. This is particularly useful for showing code examples or documentation specific to different programming languages or frameworks.

This content only appears when you select JavaScript.

JavaScript
console.log("Hello from JavaScript!");

This content only appears when you select Python.

Python
print("Hello from Python!")
JavaScript
<View title="JavaScript" icon="js">
  This content only appears when you select JavaScript.

  ```javascript
  console.log("Hello from JavaScript!");
  ```
</View>

<View title="Python" icon="python">
  This content only appears when you select Python.

  ```python
  print("Hello from Python!")
  ```
</View>

The table of contents automatically updates to show only the headings for the currently selected view. When you switch between views using the multi-view dropdown, the table of contents refreshes to display the relevant headings for that view.

If you have different heading structures in each view, users only see the headings that are relevant to their selected language or framework.

  • title (string, required) — The title that identifies this view. Each unique title on the page becomes an option in the multi-view dropdown.

  • icon (string) — A Font Awesome, Lucide, or Tabler icon, a single emoji, a URL to an icon, or a relative path to an icon.

  • iconType (string) — For Font Awesome icons only: One of regular, solid, light, thin, sharp-solid, duotone, brands.

  • className (string) — Additional CSS classes to apply to the view container.

Suggest an edit

Propose a replacement for this page. The site team reviews it before applying any changes.

Export
Documentation menu