TidalUI

Mention input preview

Write native textarea content and insert people or records from supplied suggestions.

pro · Forms · composite

When to use

Alternatives

Configure components.json and the @tidal-pro namespace before installing Pro components.

Installation

npx shadcn@latest add @tidal-pro/mention-input

Import components/ui/tidal.css, components/ui/mention-input.css. Wrap installed components in tidal-scope.

Preview

Mention input component preview

Open interactive preview

Minimal example

import"./components/ui/tidal.css";
import"./components/ui/mention-input.css";
import{TidalMentionInput}from"./components/ui/mention-input";
export default()=><div className="tidal-scope"><TidalMentionInput label={"Demo"} onValueChange={() => {}} suggestions={[{id:"example",label:"Demo",value:"value"}]} value={"value"}/></div>;

API and props

TidalMentionInput.label (required)
ReactNode

Required label value accepted by this exported component.

TidalMentionInput.onValueChange (required)
(value: string) => void

Callback invoked when the value change interaction is proposed.

TidalMentionInput.suggestions (required)
ReadonlyArray<TidalMentionSuggestion>

Required suggestions value accepted by this exported component.

TidalMentionInput.value (required)
string

Required value value accepted by this exported component.

TidalMentionInput.aria-disabled
Booleanish | undefined

Accessible disabled supplied by the consumer.

TidalMentionInput.aria-invalid
boolean | "true" | "false" | "grammar" | "spelling" | undefined

Accessible invalid supplied by the consumer.

TidalMentionInput.description
ReactNode

Optional description value accepted by this exported component.

TidalMentionInput.disabled
boolean | undefined

Optional disabled value accepted by this exported component.

TidalMentionInput.emptyMessage
ReactNode

Optional empty message value accepted by this exported component.

TidalMentionInput.error
ReactNode

Optional error value accepted by this exported component.

TidalMentionInput.maxSuggestions
number | undefined

Optional max suggestions value accepted by this exported component.

TidalMentionInput.onChange
ChangeEventHandler<HTMLTextAreaElement, HTMLTextAreaElement> | undefined

Callback invoked when the change interaction is proposed.

TidalMentionInput.onMentionSelect
((suggestion: TidalMentionSuggestion, nextValue: string) => void) | undefined

Callback invoked when the mention select interaction is proposed.

TidalMentionInput.readOnly
boolean | undefined

Optional read only value accepted by this exported component.

TidalMentionInput.rootClassName
string | undefined

Optional root class name value accepted by this exported component.

TidalMentionInput.suggestionsLabel
string | undefined

Optional suggestions label value accepted by this exported component.

TidalMentionInput.trigger
string | undefined

Optional trigger value accepted by this exported component.

Complete usage

Full example, stylesheet imports, API and accessibility documentation

Gotchas