smrt
Open the smrt source on GitHub Switch to dark color scheme
← All UI components

Chat · Components

MentionAutocomplete

MentionAutocomplete - @mention suggestions popup. Floating dropdown positioned near cursor. Shows matching profile names with optional avatars. Keyboard navigable.

Public export

typescript
import { MentionAutocomplete } from '@happyvertical/smrt-chat/svelte';
Import path
@happyvertical/smrt-chat/svelte
Props
5
Props described
5 of 5
Bindable state
0
Callback events
2
Verified release
0.62.10

Props

NameTypeRequiredDescription
querystringYesCurrent search query (text after
suggestionsArray<{ id: string; name: string; avatarUrl?: string; }>YesMatching suggestions
onselect(id: string) => voidYesSelect a suggestion
isVisiblebooleanYesWhether the popup is visible
oncancel() => voidNoDismiss the popup (e.g. Escape pressed) without selecting

Bindable state

This component has no bindable public state.

Callback events

  • onselect(id: string) => void
  • oncancel() => void

Examples and explanation