Jamdesk Documentation logo

View

Create documentation that adapts to the reader's framework or language choice. Entire sections switch based on user selection.

Views let you create documentation that adapts to the reader's framework or language choice. Unlike Tabs (which show multiple options side by side), Views completely hide unselected content—creating a cleaner experience when entire sections differ between frameworks.

Use Views when:

  • Entire page sections differ by framework (not just code snippets)
  • Tutorials have different steps for different technologies
  • Getting started guides vary significantly by platform

For code examples that differ by language, use CodeGroup. For procedures with minor differences, use Tabs. Use Views when entire sections of content are framework-specific.

Basic Usage

Create views for different languages:

<View title="JavaScript" icon="js">

  This content is only visible when JavaScript is selected.

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

<View title="Python" icon="python">

  This content is only visible when Python is selected.

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

How It Works

When you add View components to a page:

  1. A dropdown selector appears at the top of the content
  2. Users can switch between views using the dropdown
  3. Only the selected view's content is visible

View vs Tabs vs CodeGroup

ComponentBest ForScope
ViewEntire sections that differ by frameworkPage-wide content switching
TabsQuick comparisons, package managersInline content switching
CodeGroupSame operation in multiple languagesCode blocks only

Example scenarios:

  • "Install with npm vs yarn" → Tabs (small difference)
  • "JavaScript fetch vs Python requests" → CodeGroup (code comparison)
  • "React tutorial vs Vue tutorial" → View (entire section differs)

Props

stringrequired

The title displayed in the dropdown selector. Must be unique within the page.

string

A Font Awesome icon, Lucide icon, URL to an icon, or relative path to an icon.

stringdefault: solid

For Font Awesome icons only. Options: regular, solid, light, thin, sharp-solid, duotone, brands.

What's Next?

Components Overview

Browse all available components

MDX Basics

Learn how to use components in MDX