Flutter docs
Default skin

Mentions

Used to mention someone or something in an input.

When to use

When you need to mention someone or something.

Examples

Basic

Basic usage.

Variants

Variants of Mentions, there are four variants: outlined filled borderless and underlined.

With Form

Controlled mode, for example, to work with Form.

disabled or readOnly

Configure disabled and readOnly.

Customize Popup

Customize the dropdown menu rendering via popupRender.

autoSize

Height autoSize.

Custom semantic dom styling

You can customize the semantic dom style of Mentions by passing objects/functions through classNames and styles. For example, set the textarea to be resizable.

Size

Configure size via size property.

Asynchronous loading

async.

Customize Trigger Token

Customize Trigger Token by prefix props. Default to @, Array<string> also supported.

Placement

Change the suggestions placement.

With clear icon

Customize clear button.

Status

Add status to Mentions with status, which could be error or warning.

API

Mentions and Mentions.Option are exported from @ceebee/ui/client.

Mention

PropertyDescriptionTypeDefaultVersion
allowClearWhether to show a clear icon to remove mentions contentboolean | { clearIcon?: ReactNode, disabled?: boolean }false5.13.0, disabled: 6.4.0
autoSizeTextarea height autosize feature, can be set to true | false or an object { minRows: 2, maxRows: 6 }boolean | objectfalse—
classNamesCustomize class for each semantic structure inside the component. Supports object or function.Record<SemanticDOM, string> | (info: { props })=> Record<SemanticDOM, string>-—
defaultValueDefault valuestring-—
filterOptionCustomize filter option logicfalse | (input: string, option: OptionProps) => boolean-—
getPopupContainerSet the mount HTML node for suggestions() => HTMLElement-—
notFoundContentSet mentions content when not matchReactNodeNot Found—
placementSet popup placementtop | bottombottom—
popupRenderCustomize the dropdown menu rendering(menu: React.ReactElement) => ReactNode-6.6.0
prefixSet trigger prefix keywordstring | string\[]@—
splitSet split string before and after selected mentionstring——
sizeThe size of the input boxlarge | medium | small-—
statusSet validation status'error' | 'warning' | 'success' | 'validating'-4.19.0
validateSearchCustomize trigger search logic(text: string, props: MentionsProps) => void-—
valueSet value of mentionsstring-—
variantVariants of Inputoutlined | borderless | filled | underlinedoutlined5.13.0 | underlined: 5.24.0
onBlurTrigger when mentions lose focus() => void-—
onChangeTrigger when value changed(text: string) => void-—
onClearCallback when click the clear button() => void-5.20.0
onFocusTrigger when mentions get focus() => void-—
onResizeThe callback function that is triggered when textarea resizefunction({ width, height })-—
onSearchTrigger when prefix hit(text: string, prefix: string) => void-—
onSelectTrigger when user select the option(option: OptionProps, prefix: string) => void-—
onPopupScrollTrigger when mentions scroll(e: Event) => void-5.23.0
optionsOption ConfigurationOptions\[]5.1.0
stylesCustomize inline style for each semantic structure inside the component. Supports object or function.Record<SemanticDOM, CSSProperties> | (info: { props })=> Record<SemanticDOM, CSSProperties>-—

Option

PropertyDescriptionTypeDefaultVersion
valueValue inserted when selectedstring-—
labelTitle of the optionReact.ReactNode-—
keyThe key value of the optionstring-—
disabledOptionalboolean-—
classNameclassNamestring-—
styleThe style of the optionReact.CSSProperties-—