Jamdesk Documentation logo

Prompt

使用 Prompt 以可复制的形式展示可复用的 AI 指令,并支持内置的打开操作、自定义目标、图标和紧凑显示选项。

<Prompt> 组件将一组可复用的指令转换为一张卡片,读者可以复制它,或在受支持的 AI 工具中打开。复制和打开操作使用标签之间人类可见的确切编写内容。

基本用法

每个 Prompt 都有一个复制操作。最简单的版本无需任何属性:

Explain how API key rotation works for a developer using our REST API for the first time.

Prompt

Explain how API key rotation works for a developer using our REST API for the first time.
<Prompt>

Explain how API key rotation works for a developer using our REST API for the first time.

</Prompt>

标题和描述

使用 title 为任务添加标签。与 Mintlify 兼容的 description 属性会用更简短的摘要替换可见预览。复制和打开操作仍然使用标签之间的完整人类可见内容。

Draft a release note

Write a concise release note for a developer audience.

Draft a release note

Write a release note for the new API key rotation endpoint.

- Address backend developers.
- Lead with the user benefit.
- Include one request example.
<Prompt
  title="Draft a release note"
  description="Write a concise release note for a developer audience."
  actions={["copy", "claude"]}
>
Write a release note for the new API key rotation endpoint.

- Address backend developers.
- Lead with the user benefit.
- Include one request example.

</Prompt>

复制操作始终存在。为兼容起见,接受显式的 "copy" 操作,但通常不需要。

Prompt copies the exact human-visible authored content. In a prompt that contains Visibility, Jamdesk drops human-only wrapper tags from the copied text and keeps their contents. Agent-only subtrees are excluded. Jamdesk also excludes Visibility with an expression-valued for prop, or with an audience hidden by a later spread attribute. Its audience can't be determined statically. Visibility with no for prop, shorthand for, or an invalid literal audience stays visible. A Prompt hidden inside agent-only or expression/spread-obscured Visibility has no copyable source.

打开操作

添加 claude、cursor、chatgpt、perplexity 或 gemini,让读者在这些工具中打开提示词。每个操作都会显示其品牌图标。第一个有效的打开操作显示在复制按钮旁边,其余的显示在“更多”菜单中。

Compare authentication flows

Compare the session-token and API-key authentication flows in this repository. List their security tradeoffs and recommend which flow each client type should use.

Compare authentication flows

Compare the session-token and API-key authentication flows in this repository. List their security tradeoffs and recommend which flow each client type should use.
<Prompt
  title="Compare authentication flows"
  actions={["claude", "cursor", "chatgpt", "perplexity", "gemini"]}
>
Compare the session-token and API-key authentication flows in this repository.
List their security tradeoffs and recommend which flow each client type should use.

</Prompt>

Clicking an open-in action sends the full copyable prompt to the selected third party. Do not include secrets, personal data, or proprietary content unless you intend to share it under that provider's privacy policy. Copy does not open a third-party service.

自定义 URL 操作

自定义操作接受 label、HTTPS 或 HTTP 的 url,以及可选的图标。将 {prompt} 放在路径段、查询值或片段中,以控制 URL 编码后的提示词放置位置。如果省略占位符,Jamdesk 会添加 prompt 查询参数。

Research this migration

Compare this migration plan with the current public API contract. Identify breaking changes, missing rollback steps, and tests needed before release.

Research this migration

Compare this migration plan with the current public API contract. Identify breaking changes, missing rollback steps, and tests needed before release.
<Prompt
  title="Research this migration"
  actions={[
    {
      label: "Search the web",
      url: "https://www.google.com/search?q={prompt}",
      icon: "magnifying-glass",
    },
    "claude",
  ]}
>
Compare this migration plan with the current public API contract. Identify
breaking changes, missing rollback steps, and tests needed before release.

</Prompt>

自定义操作的 URL 必须是不含凭据的 http: 或 https: URL。Jamdesk 会拒绝其他协议、源或查询键中的占位符,以及长度超过 8,000 个字符的最终操作 URL。当某个打开操作被拒绝时,复制功能仍然可用。

自定义图标

将 icon 设置为 Font Awesome 名称、图片 URL 或路径,或内联 SVG。使用 iconType 为不带前缀的 Font Awesome 名称选择样式。

Plan a tutorial

Outline a hands-on tutorial that gets a new user from installation to a successful API request in under ten minutes.

Plan a tutorial

Outline a hands-on tutorial that gets a new user from installation to a successful API request in under ten minutes.
<Prompt title="Plan a tutorial" icon="pen-nib" iconType="duotone">

  Outline a hands-on tutorial that gets a new user from installation to a
  successful API request in under ten minutes.

</Prompt>

有关可用名称和样式,请参阅 图标。

紧凑显示

预览最多显示三行,较长的提示词会可滚动。展开控件会打开完整提示词。设置 singleLine 可将预览裁剪为一行。复制和打开操作仍然使用完整的人类可见提示词。

Summarize the API

Summarize the public API in five bullets: - Authentication and token lifetimes. - Pagination conventions. - Rate limits and retry guidance. - Error format and common codes. - Versioning and deprecation policy.

Summarize the API

Summarize the public API in five bullets:

- Authentication and token lifetimes.
- Pagination conventions.
- Rate limits and retry guidance.
- Error format and common codes.
- Versioning and deprecation policy.

当仅标签就足以为读者提供上下文时,可将 hidePrompt 与 title 一起使用:

Generate a migration checklist

Generate a migration checklist

Create a migration checklist for moving from API v1 to v2. Include prerequisites, code changes, validation steps, rollback criteria, and owner sign-off.
<Prompt title="Summarize the API">

  Summarize the public API in five bullets:

  - Authentication and token lifetimes.
  - Pagination conventions.
  - Rate limits and retry guidance.
  - Error format and common codes.
  - Versioning and deprecation policy.

</Prompt>

<Prompt title="Generate a migration checklist" hidePrompt actions={["claude"]}>

  Create a migration checklist for moving from API v1 to v2. Include
  prerequisites, code changes, validation steps, and rollback criteria.

</Prompt>

只有设置了 title 时,hidePrompt 才会隐藏预览。没有 title 时,提示词保持可见。

属性

ReactNode

开始标签与结束标签之间的提示词内容。Jamdesk 为复制和打开操作保留人类可见的确切编写 Markdown。除非 description 替换了预览或 hidePrompt 隐藏了预览,否则它也会将此内容渲染为预览。可见性过滤遵循上述规则。

string

显示在卡片标题栏中的标签。默认不显示标题。

string

为 Mintlify 兼容性而接受的紧凑型内联 Markdown 预览。它只更改可见预览。复制和打开操作仍然使用标签之间的人类可见内容。

string | ReactElementdefault: sparkles

标题栏图标。接受 Font Awesome 名称、图片 URL 或路径,或内联 SVG 元素。

regular | solid | light | thin | sharp-solid | duotone | brands

应用于不带前缀的字符串图标的 Font Awesome 样式。它不会改变图片 URL、路径、已带前缀的名称或内联 SVG 元素。

('copy' | 'cursor' | 'claude' | 'chatgpt' | 'perplexity' | 'gemini' | CustomAction)[]default: []

按显示顺序排列的打开操作。CustomAction 为 { label: string; url: string; icon?: string }。复制始终显示。显式的 copy 条目会被接受并去重。无效、重复或过长的打开操作会被忽略。

boolean | stringdefault: false

当设置为布尔值 true 或字符串 "true" 时,将可见预览裁剪为一行。字符串 "false" 则不启用此功能。所有操作仍然使用完整提示词。

boolean | stringdefault: false

当存在 title 且值为布尔值 true 或字符串 "true" 时,隐藏可见预览。没有 title 时,预览保持可见。字符串 "false" 则不启用此功能。

string

应用于 Prompt 卡片根元素的附加 CSS 类名。

接下来做什么?

Writing with AI

将页面需求转换为聚焦的提示词

Components Overview

浏览其余的 MDX 组件库