Prompts
Used to display a set of predefined questions or suggestions related to the current context.
Examples
Basic
Disabled state
☕️ 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?
Fade-in effect
✨ Inspirational Sparks and Marvelous Tips
Vertical layout
🤔 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?
Wrap
✨ 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?
Responsive width
✨ 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!
Nested composition
Accessibility: When onItemClick is passed in, clickable prompt items will render as native buttons, can be focused with Tab, and activated with Enter / Space; disabled items will have the disabled attribute. Nested parent items and lists without onItemClick will still render as divs to avoid invalid buttons.
API
PromptsProps
| Prop | Description | Type | Default | Version |
|---|---|---|---|---|
| classNames | Custom style class names, used for different parts of each prompt item | Record<SemanticType, string> | - | - |
| fadeIn | Enable fade-in on render | boolean | false | - |
| fadeInLeft | Whether to enable rendering with a left-to-right fade-in | boolean | false | - |
| items | List containing multiple prompt items | PromptProps[] | - | - |
| prefixCls | Prefix for style class names | string | - | - |
| rootClassName | Root class name | string | - | - |
| styles | Custom styles, used for different parts of each prompt item | Record<SemanticType, CSSProperties> | - | - |
| title | Title displayed at the top of the prompt list | VNode | string | (() => VNode | string) | - | - |
| vertical | When set to true, the prompt list will be arranged vertically | boolean | false | - |
| wrap | When set to true, the prompt list will automatically wrap | boolean | false | - |
| onItemClick | Callback function when a prompt item is clicked. If passed, clickable items are rendered as buttons and support keyboard activation | (info: { data: PromptProps }) => void | - | - |
SemanticType
type SemanticType = 'root' | 'list' | 'item' | 'itemContent' | 'title' | 'subList' | 'subItem';Prompts Slots
| Slot | Description |
|---|---|
| title | The title displayed at the top of the prompt list |
Prompts Ref
| Prop | Description | Type |
|---|---|---|
| nativeElement | The root DOM element of the component | HTMLDivElement |
PromptProps
| Property | Description | Type | Default | Version |
|---|---|---|---|---|
| children | Nested sub-prompt items | PromptProps[] | - | - |
| description | Prompt description providing additional information | VNode | string | - |
| disabled | Disables click events when set to true | boolean | false | - |
| icon | The prompt icon displayed on the left side of the prompt item | VNode | - | - |
| key | Unique identifier used to distinguish each prompt item | string | - | - |
| label | Prompt label displaying the main content of the prompt | 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
This component has no custom Component Token. Customize it through global Design Tokens.