signavio / react-mentions

@mention people in a textarea
https://react-mentions.vercel.app
Other
2.43k stars 567 forks source link

Custom suggestions dropdown component #443

Open soanvig opened 3 years ago

soanvig commented 3 years ago

Hello.

Is custom suggestion dropdown component considered?

anatooly commented 3 years ago

What about this?

<Mention
  trigger="@"
  data={fetchUsers}
  renderSuggestion={renderSuggestion}
/>
  const renderSuggestion = (
    suggestion,
    search,
    highlightedDisplay,
    index,
    focused,
  ) => {
    return (
      <div className={styles.suggestion}>
        <Avatar user={suggestion.user} />
        <div className={styles.title}>{highlightedDisplay}</div>
      </div>
    )
  }