Lets a user insert an emoji by typing :query or from the editor's button. It keeps the state of TextEditor's emoji picker, and TextEditor renders the picker and handles its keys.

Functions

f
useEmojiTrigger(replace: (
start: number,
end: number,
text: string,
word: boolean
) => void
): UseEmojiTriggerResult

Returns the picker's state and the functions that drive it. A pick goes through replace, TextEditor's function that puts the text over [start, end) of the textarea's value, followed by a space when word is set.

Interfaces

I
UseEmojiTriggerResult

Returned by useEmojiTrigger to TextEditor.

Type Aliases

T
EmojiMode = "closed" | "inline" | "browse"

Returned by useEmojiTrigger to TextEditor, which keys its focus and key handling on it. An inline picker was opened by a typed :query: focus stays in the textarea and a pick replaces the query. A browse picker was opened from the button: focus goes to its search and a pick lands at the caret.