Introduction

A multi-trigger inline mentions component for React. Built on contenteditable with a framework-agnostic core.

What is @skyastrall/mentions?

A production-grade mentions input that supports @users, #tags, /commands, and custom triggers — each with its own data source, color, and configuration.

It ships as two packages:

Three API Layers

Pick the level of control you need:

1. Drop-in Component

One import, one component, works out of the box with default styling.

<Mentions
  triggers={[{ char: "@", data: users }]}
  onChange={(markup, plainText) => {}}
/>

2. Compound Components

Control the layout. The library handles state, ARIA, and keyboard navigation.

<Mentions triggers={triggers}>
  <Mentions.Editor placeholder="Type @..." />
  <Mentions.Portal>
    <Mentions.List>
      <Mentions.Item render={({ item }) => <UserCard user={item} />} />
    </Mentions.List>
  </Mentions.Portal>
</Mentions>

3. Headless Hook

Full control. You get props, state, and helpers — render whatever you want.

const { inputProps, listProps, getItemProps, editorRef, isOpen, items } =
  useMentions({ triggers });

Key Features

Next Steps

Installation or Quick Start.