Skip to content

Add sectionTitle prop to <Mention> for grouped suggestion headers#787

Open
RonenMars wants to merge 2 commits into
signavio:masterfrom
RonenMars:feat/section-titles
Open

Add sectionTitle prop to <Mention> for grouped suggestion headers#787
RonenMars wants to merge 2 commits into
signavio:masterfrom
RonenMars:feat/section-titles

Conversation

@RonenMars
Copy link
Copy Markdown

Add functionality of displaying sections inside the component.

Preview:
image

Functionally:
When multiple <Mention> components share the same trigger, their suggestions are now displayed under labeled section headers in the dropdown. Pass sectionTitle to any <Mention> to opt in — if that group returns no results, its header is suppressed automatically.

<MentionsInput value={value} onChange={onChange}>
  <Mention trigger="@" data={colleagues} sectionTitle="Colleagues" />
  <Mention trigger="@" data={bots} sectionTitle="Bots" />
</MentionsInput>

The header is styled via the sectionTitle key in the style prop, consistent with how all other parts of the overlay are styled.

  Adds a `sectionTitle` prop to `<Mention>` that renders a labeled header
  above each group's suggestions in the overlay. The header is only shown
  when the group has results, and is styled via the `sectionTitle` key in
  the style prop.
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Apr 19, 2026

⚠️ No Changeset found

Latest commit: b7b2b5e

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@hbmartin
Copy link
Copy Markdown

@RonenMars I don't think this project is maintained, would you consider opening a PR for https://github.com/hbmartin/react-mentions-ts ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants