Mention
Mention component.
#
When To UseWhen need to mention someone or something.
#
Examples#
Basic我想吃一份{{食物}}
#
Creatable我想吃一份{{食物}}
#
Creatable & Highlight Invalid我想吃一份{{食物}}
#
Disabled我想吃一份{{食物}}
I want a {{food}}
Something went wrong!
#
APIProperty | Description | Type | Default |
---|---|---|---|
suggestions | Suggestion content | string[] | [] |
disabled | Tell if the mention is disabled. | boolean | false |
creatable | Create suggestion when mention text which is not exists in suggestions props | boolean | false |
highlightInvalid | highlight the invalid mentioned text | boolean | false |
formatCreateText | format the create text | (text: string) => string | text => Press Enter to create mention: {text} |
onMentionCreate | Trigger when the new suggestion created | (newMention: string) => void | |
value | Set value of mentions | string | |
defaultValue | Default value | string | |
onBlur | Trigger when mentions lose focus | () => void | |
onChange | Trigger when value changed | (value: string) => void |