跳到主要内容

XPrompts

Displays a list of suggested prompts for the user to click and send.

Source: Re-exported from @ant-design/x. Full documentation: Ant Design X Prompts

Basic Usage

import { XPrompts } from '@vef-framework-react/components';

const items = [
{ key: '1', label: 'What is VEF Framework?' },
{ key: '2', label: 'How do I create a form?' },
{ key: '3', label: 'Show me a table example.' },
];

export default function Demo() {
return (
<XPrompts
title="Suggested questions"
items={items}
onItemClick={(info) => console.log('Selected:', info.data.label)}
/>
);
}

API

PropTypeDefaultDescription
itemsPromptItem[]Prompt list
titleReactNodeSection title
onItemClick(info: { data: PromptItem }) => voidClick handler
wrapbooleanfalseAllow items to wrap
verticalbooleanfalseVertical layout

For the full API, see Ant Design X Prompts docs.