Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions components/view.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
</Tip>

<View title="JavaScript" icon="js">
This content is only visible when JavaScript is selected.

Check warning on line 14 in components/view.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

components/view.mdx#L14

In general, use active voice instead of passive voice ('is selected').

```javascript
console.log("Hello from JavaScript!");
Expand All @@ -19,7 +19,7 @@
</View>

<View title="Python" icon="python">
This content is only visible when Python is selected.

Check warning on line 22 in components/view.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

components/view.mdx#L22

In general, use active voice instead of passive voice ('is selected').

```python
print("Hello from Python!")
Expand All @@ -38,7 +38,7 @@
</View>

<View title="Python" icon="python">
This content is only visible when Python is selected.

Check warning on line 41 in components/view.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

components/view.mdx#L41

In general, use active voice instead of passive voice ('is selected').

```python
print("Hello from Python!")
Expand All @@ -52,6 +52,22 @@

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

## Deep anchor links

Each `View` automatically generates an anchor ID from its title, so you can link directly to a specific view. When a user visits a URL with a view's anchor hash, that view activates automatically.

```text
https://your-docs.com/page-with-views#python
```

You can also link to headings, accordions, or other anchored elements inside a view. The correct view activates and scrolls to the target element.

```text
https://your-docs.com/page-with-views#install-the-sdk
```

When a user switches views using the dropdown, the URL hash updates to match the selected view, preserving any existing query parameters. This makes view selections shareable.

## Properties

<ResponseField name="title" type="string" required>
Expand Down
12 changes: 12 additions & 0 deletions guides/linking.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,18 @@

This accordion is reachable at `#install` instead of the auto-generated `#installation-steps`. See [Accordions](/components/accordions) for more.

### View deep links

Pages that use the [View component](/components/view) support deep linking to a specific view or to elements inside a view. Each view generates an anchor ID from its title, so `#python` activates the view titled "Python".

You can also link to a heading or accordion inside a view. The correct view activates and the page scrolls to the target element:

```text
https://your-docs.com/page-with-views#install-the-sdk
```

When users switch views using the dropdown, the URL hash updates automatically, making view selections shareable. See [View](/components/view#deep-anchor-links) for more details.

### API playground deep links

To open the API playground in a link, append `?playground=open` to any endpoint page URL:
Expand Down Expand Up @@ -125,7 +137,7 @@

### Link prerequisites explicitly

When a page assumes prior steps, link to them at the top rather than assuming users will find them:

Check warning on line 140 in guides/linking.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

guides/linking.mdx#L140

Avoid using 'will'.

```mdx
## Prerequisites
Expand All @@ -139,7 +151,7 @@

### Build topic clusters

Link related content together to help users—and search engines—understand how your documentation is organized:

Check warning on line 154 in guides/linking.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

guides/linking.mdx#L154

In general, use active voice instead of passive voice ('is organized').

```mdx
## Related topics
Expand Down Expand Up @@ -196,7 +208,7 @@
</Accordion>

<Accordion title="What happens to bookmarked links when I reorganize my documentation?">
Without redirects, bookmarked and shared links become 404 errors. Set up redirects in your `docs.json` whenever you move or rename a page. Redirects are cheap to add and prevent a poor user experience for anyone who linked to your documentation from an external source—blog posts, Stack Overflow answers, internal wikis.

Check warning on line 211 in guides/linking.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

guides/linking.mdx#L211

Use the Oxford comma in 'Without redirects, bookmarked and'.
</Accordion>

<Accordion title="How many internal links should a page have?">
Expand Down
Loading