Skip to main content

Mention

Mention component.

When To Use#

When need to mention someone or something.

Examples#

import { Mention } from 'tailor-ui';

Basic#

我想吃一份{{}}

Creatable#

我想吃一份{{}}

Creatable & Highlight Invalid#

我想吃一份{{}}

Disabled#

我想吃一份{{}}
I want a {{food}}
Something went wrong!

API#

PropertyDescriptionTypeDefault
suggestionsSuggestion contentstring[][]
disabledTell if the mention is disabled.booleanfalse
creatableCreate suggestion when mention text which is not exists in suggestions propsbooleanfalse
highlightInvalidhighlight the invalid mentioned textbooleanfalse
formatCreateTextformat the create text(text: string) => stringtext => Press Enter to create mention: {text}
onMentionCreateTrigger when the new suggestion created(newMention: string) => void
valueSet value of mentionsstring
defaultValueDefault valuestring
onBlurTrigger when mentions lose focus() => void
onChangeTrigger when value changed(value: string) => void