Components / Hashtag Textarea

Hashtag Textarea

Writing captions with hashtag autocomplete: typing # opens a suggestion list filtered from a keyword list, built on Textarea plus Popover and Command.

import { HashtagTextarea } from '@layers/ui/hashtag-textarea'

Rendered stock

House rules

  • Controlled value/onChange; hashtagOptions is a plain keyword list without the # prefix.
  • Selecting a suggestion inserts #keyword plus a trailing space and restores the caret after it.
  • While the list is open, arrow keys, Enter, and Tab drive it and Escape dismisses it; other keys fall through to the textarea.