2.10.0
中文
Skip to content

Suggestion ​

Components used to provide users with quick prompts.

When to use ​

Need to build an input box for a dialogue scenario.

Examples ​

Basic usage ​

Full-row width ​

Custom ​

API ​

SuggestionsProps ​

PropDescriptionTypeDefaultVersion
blockIs the width of the entire linebooleanfalse-
childrenCustom input box({ onTrigger, onKeyDown }) => VNode--
itemsSuggested ListSuggestionItem[] | ((info: T) => SuggestionItem[])--
openControlled Open Panelboolean--
rootClassNameRoot element style class namestring--
onSelectSelect Suggestion Item Pullback(value: string) => void--
onOpenChangeCallback for panel open state changes(open: boolean) => void--

onTrigger ​

typescript
type onTrigger<T> = (info: T | false) => void;

Suggestion accepts generics to customize the parameter type passed to the items renderProps. When false is passed, the suggestion panel is closed.

Suggestions Slots ​

SlotDescriptionType
defaultUsed to customize the input box

SuggestionItem ​

PropertyDescriptionTypeDefaultVersion
childrenSub-itemsSuggestionItem[]--
extraExtra content of the suggestion itemVNodestring-
iconIcon of the suggestion itemVNode--
labelDisplay content of the suggestion itemVNodestring-
valueValue of the suggestion itemstring--

Design Token ​

This component has no custom Component Token. Customize it through global Design Tokens.

Contributors ​

Contributors

Loading contributors…