mirror of
https://github.com/mintlify/docs.git
synced 2026-09-14 13:35:46 +08:00
d53a36bd09
Co-authored-by: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com>
68 lines
3.0 KiB
Plaintext
68 lines
3.0 KiB
Plaintext
---
|
|
title: "Visibility"
|
|
description: "Use the visibility component to show different content to humans on the web UI and to AI agents in Markdown output for conditional rendering."
|
|
keywords: ["visibility", "agents", "humans", "markdown", "AI", "conditional content"]
|
|
boost: 3
|
|
---
|
|
|
|
Use the `Visibility` component to show different content to humans reading your site versus AI agents processing the Markdown output. This lets you customize information for each audience without maintaining separate pages.
|
|
|
|
On your published site, content marked `for="humans"` renders normally and content marked `for="agents"` is hidden. In [Markdown page views](/ai/markdown-export) (`.md` URLs), the opposite applies. Agent content renders in the Markdown output and human-only content does not.
|
|
|
|
## Example
|
|
|
|
```mdx
|
|
<Visibility for="humans">
|
|
<Note>
|
|
You are viewing this content **in web**.
|
|
|
|
This content displays normally on standard pages of your site.
|
|
|
|
Use it for a step like: Click the **Get started** button in the top-right corner to create your account.
|
|
|
|
In this example, UI-oriented instructions appear on the standard page. View the [Markdown version of this page](https://mintlify.com/docs/components/visibility.md) to see the API-oriented instructions for agents.
|
|
</Note>
|
|
</Visibility>
|
|
|
|
<Visibility for="agents">
|
|
> You are viewing this content **in Markdown**.
|
|
>
|
|
> This content only appears on the Markdown version of pages.
|
|
>
|
|
> Use it for information that only agents use like: To create an account, call `POST /v1/accounts` with a valid email address.
|
|
>
|
|
> In this example, API-oriented instructions appear on the Markdown version of the page. View the [standard page](https://mintlify.com/docs/components/visibility) to see the UI-oriented instructions for humans.
|
|
</Visibility>
|
|
```
|
|
|
|
<Visibility for="humans">
|
|
<Note>
|
|
You are viewing this content **in web**.
|
|
|
|
This content displays normally on standard pages of your site.
|
|
|
|
Use it for a step like: Click the **Get started** button in the top-right corner to create your account.
|
|
|
|
In this example, UI-oriented instructions appear on the standard page. View the [Markdown version of this page](https://mintlify.com/docs/components/visibility.md) to see the API-oriented instructions for agents.
|
|
</Note>
|
|
</Visibility>
|
|
|
|
<Visibility for="agents">
|
|
> You are viewing this content **in Markdown**.
|
|
>
|
|
> This content only appears on the Markdown version of pages.
|
|
>
|
|
> Use it for information that only agents use like: To create an account, call `POST /v1/accounts` with a valid email address.
|
|
>
|
|
> In this example, API-oriented instructions appear on the Markdown version of the page. View the [standard page](https://mintlify.com/docs/components/visibility) to see the UI-oriented instructions for humans.
|
|
</Visibility>
|
|
|
|
## Properties
|
|
|
|
<ResponseField name="for" type="string" required>
|
|
The audience for the wrapped content. Must be one of:
|
|
|
|
- `humans`: Content visible on the web and excluded from Markdown output
|
|
- `agents`: Content hidden on the web and included in Markdown output
|
|
</ResponseField>
|