2.0.0
Skip to content

Prompts 提示集 ​

用于显示一组与当前上下文相关的预定义的问题或建议。

代码演示 ​

基本 ​

不可用状态 ​

☕️ It's time to relax!
Task Completion Secrets

What are some tricks for getting tasks done?

Time for a Coffee Break

How to rest effectively after long hours of work?

不可用状态

要将 prompt 标记为禁用,请向 prompt 添加 disabled 属性。

渐入效果 ​

✨ Inspirational Sparks and Marvelous Tips
Ignite Your Creativity

Got any sparks for a new project?

Uncover Background Info

Help me understand the background of this topic.

Efficiency Boost Battle

How can I work faster and better?

Tell me a Joke

Why do not ants get sick? Because they have tiny ant-bodies!

Common Issue Solutions

How to solve common issues? Share some tips!

渐入效果

通过 fadeIn 和 fadeInLeft 属性控制渐入动画效果。

纵向展示 ​

🤔 You might also want to ask:

How to rest effectively after long hours of work?

What are the secrets to maintaining a positive mindset?

How to stay calm under immense pressure?

纵向展示

使用 vertical 属性,控制 Prompts 展示方向。

可换行 ​

✨ Inspirational Sparks and Marvelous Tips

Got any sparks for a new project?

Help me understand the background of this topic.

How to solve common issues? Share some tips!

How can I work faster and better?

What are some tricks for getting tasks done?

How to rest effectively after long hours of work?

What are the secrets to maintaining a positive mindset?

How to stay calm under immense pressure?

可换行

使用 wrap 属性,控制 Prompts 超出区域长度时是否可以换行。

响应式宽度 ​

✨ Inspirational Sparks and Marvelous Tips
Ignite Your Creativity

Got any sparks for a new project?

Uncover Background Info

Help me understand the background of this topic.

Efficiency Boost Battle

How can I work faster and better?

Tell me a Joke

Why do not ants get sick? Because they have tiny ant-bodies!

Common Issue Solutions

How to solve common issues? Share some tips!

响应式宽度

配合 wrap 与 styles 固定宽度展示。

嵌套组合 ​

API ​

PromptsProps ​

属性说明类型默认值版本
classNames自定义样式类名,用于各个提示项的不同部分Record<SemanticType, string>--
fadeIn是否开启渲染渐入booleanfalse-
fadeInLeft是否开启渲染从左到右渐入booleanfalse-
items包含多个提示项的列表PromptProps[]--
prefixCls样式类名的前缀string--
rootClassName根节点的样式类名string--
styles自定义样式,用于各个提示项的不同部分Record<SemanticType, CSSProperties>--
title显示在提示列表顶部的标题VNode | string | (() => VNode | string)--
vertical设置为 true 时, 提示列表将垂直排列booleanfalse-
wrap设置为 true 时, 提示列表将自动换行booleanfalse-
onItemClick提示项被点击时的回调函数(info: { data: PromptProps }) => void--

SemanticType ​

typescript
type SemanticType = 'root' | 'list' | 'item' | 'itemContent' | 'title' | 'subList' | 'subItem';

Prompts Slots ​

插槽名说明
title显示在提示列表顶部的标题

Prompts Ref ​

属性说明类型
nativeElement组件根 DOM 元素HTMLDivElement

PromptProps ​

属性说明类型默认值版本
children嵌套的子提示项PromptProps[]--
description提示描述提供额外的信息VNode | string--
disabled设置为 true 时禁用点击事件booleanfalse-
icon提示图标显示在提示项的左侧VNode--
key唯一标识用于区分每个提示项string--
label提示标签显示提示的主要内容VNode | string--

Semantic DOM ​

✨ Inspirational Sparks and Marvelous Tips
Ignite Your Creativity

Got any sparks for a new project?

Uncover Background Info

Help me understand the background of this topic.

Efficiency Boost Battle

How can I work faster and better?

  • root
    根节点
  • title
    标题容器
  • list
    列表容器
  • item
    列表项
  • itemContent
    标题项内容
✨ Nested Prompts
🔥 Ignite Your Creativity

What sparks your creativity?

How do you get inspired?

🎨 Uncover Background Info

What is the background of this topic?

Why is this important?

  • subList
    子列表容器
  • subItem
    子列表项

主题变量(Design Token) ​

组件暂无自定义 Component Token,可通过全局 Design Token 定制。