logoAnt Design X

Prompts

Display a predefined set of questions or suggestion.
Import
import{ Prompts }from"@ant-design/x";

When To Use

The Prompts component is used to display a predefined set of questions or suggestion that are relevant to the current context.

Examples

✨ 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!

Basic usage.

codepen icon
External Link Icon
expand codeexpand code
☕️ 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?

To mark a prompt as disabled, add the disabled property to the prompt item.

codepen icon
External Link Icon
expand codeexpand code
🤔 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?

Use the vertical property to control the Prompts' display direction.

codepen icon
External Link Icon
expand codeexpand code
✨ 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?

Use the wrap attribute to control the layout of the Prompts.

codepen icon
External Link Icon
expand codeexpand code
✨ 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!

Use the wrap and styles properties to display with a fixed width.

codepen icon
External Link Icon
expand codeexpand code
Do you want?
Hot Topics

What are you interested in?

What's new in X?

What's AGI?

Where is the doc?

Design Guide

How to design a good product?

Know the well

Set the AI role

Express the feeling

Start Creating

How to start a new project?

Fast Start

Install Ant Design X

Online Playground

Play on the web without installing

Nest usage.

codepen icon
External Link Icon
expand codeexpand code

API

PromptsProps

PropertyDescriptionTypeDefaultVersion
classNamesCustom style class names for different parts of each prompt item.Record<SemanticType, string>--
itemsList containing multiple prompt items.PromptProps[]--
prefixClsPrefix for style class names.string--
rootClassNameStyle class name for the root node.string--
stylesCustom styles for different parts of each prompt item.Record<SemanticType, React.CSSProperties>--
titleTitle displayed at the top of the prompt list.React.ReactNode--
verticalWhen set to true, the Prompts will be arranged vertically.booleanfalse-
wrapWhen set to true, the Prompts will automatically wrap.booleanfalse-
onItemClickCallback function when a prompt item is clicked.(info: { data: PromptProps }) => void--

SemanticType

type SemanticType = 'list' | 'item' | 'content' | 'title' | 'subList' | 'subItem';

PromptProps

PropertyDescriptionTypeDefaultVersion
childrenNested child prompt items.PromptProps[]--
descriptionPrompt description providing additional information.React.ReactNode--
disabledWhen set to true, click events are disabled.booleanfalse-
iconPrompt icon displayed on the left side of the prompt item.React.ReactNode--
keyUnique identifier used to distinguish each prompt item.string--
labelPrompt label displaying the main content of the prompt.React.ReactNode--

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?

  • title
    Title container
  • list
    List container
  • item
    List item
  • itemContent
    List item content
✨ 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
    Sub-list container
  • subItem
    Sub-list item

Design Token