Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

No Mentions Empty State Block for React

A work chat's mentions popover shown open in place: a drawn list with a dashed row, a Try it field where typing @ opens five teammates, and a Post button that adds a row naming who was tagged.

Framework
UI library

Preview

Preview width

Installation

Part of Pro
Pro unlocks the code and one-line install of every Pro button and text effect, plus the MCP for your AI editor.
Have Pro already? Sign in to open it.Opens here as soon as you're Pro.

Overview

Show an empty mentions list as the popover it opens from, with this no mentions empty state for React with Base UI. The host is Hailfellow, a work chat: its header holds the real Mentions button, an at sign with the count, and under it a stage draws the inbox, a top bar with a twin of that button and a few message rows. Drawn open in place under the button is the Popover card: a drawn list of mentions with one dashed row where the first will go, a Try it Field and the Shine Button, the only colored control, Post (demo). Typing @ in the field opens a Listbox of five teammates under it, filtered as you type; picking one writes its tag, such as @Mara, into the text. Posting adds a row that names who was tagged and turns the dashed row solid. Pressing Mentions opens the real non-modal popover with the same content. The frame is ruled by Guides, and everything moves with CSS only. For the tag picker of any chat, comment box or task tracker.

FAQ

What stays in the page, and how do I make it real?

The posted mentions stay in the page's state and each row says nobody was notified: a reload empties them and Start over empties them without one. To wire it for real, send the text and the ids of the tagged teammates to your API where the code says so, add the row from the response, and notify the people tagged on your server.

What is the in-place card, and what is the real popover?

Shown open in place for the preview, so the block shows its content without a click: on load the card is drawn as a plain non-modal element under the Mentions button on the stage. Pressing the button opens the real Popover, with Escape to close it and focus back on the button, and the in-place copy stays closed until a reload. In your app keep only the Popover and its trigger.

How does tagging with @ work?

When the word you are typing starts with @, the five teammates whose first name starts with what follows it are listed under the field: arrow down to move into the list, or press Enter in the field for the top match, or pick one with the pointer. The tag goes into the text with a space after it and focus stays in the field. A word with no @ opens nothing, and an @ that matches nobody says so.

What does Post do?

It needs at least one tag: without one the field says "Tag someone first: type @ and a name" and keeps focus. A tagged post is added at the top of the list with its text, the tags in bold, "Tags Mara and Idris" and the page's fixed date. The demo lists three; at three the field says so and Start over clears them.

Is it usable with a keyboard and a screen reader?

The Mentions button is named with its count, such as Mentions, 1 post. In the card Tab reaches the field and Post, the field's note says how many teammates match, the list is named Teammates and the posted rows are a named list. The drawings are hidden from assistive technology and a polite status line says what was tagged or posted.

How does it look on a phone?

The in-place card docks to the foot of the stage so the Post button is on the first screen. The real popover keeps the catalog's own phone layout, a card under the button that never runs past the screen's edge, and nothing scrolls sideways, even at 320 px wide.

  • Pro

    A team chat before the team joins a channel: the browse dialog shown open in place over a drawn chat shell, with a hash sign, a search that filters five channels, a Join toggle on each and one Join button that counts them.

  • Pro

    A task's empty attachments popover shown open in place: a drawn paperclip holding a dashed sheet, Attachment rows that are dashed while there is room and done per file, and one Attach files button.

  • Pro

    No Notifications Empty State

    Activity and updates

    An activity inbox's bell popover shown open in place: You're all caught up, a cup of tea whose three wisps of steam turn solid as Mentions, Replies and Updates are switched on, and a Save preferences button that says Saved in this demo.

  • Pro

    No Comments Empty State

    Activity and updates

    A document reviewer's comments sheet shown open in place at the end of a drawn page: a sticky margin note drawing, a field with a 0 / 500 counter and a Comment button that stacks comments with a Delete button on each.

  • Pro

    Address Autocomplete Dialog

    Pickers and search

    A meal-kit delivery page with its address dialog shown open: typing filters eight addresses of an invented town into an inline list you can arrow through, a choice fills four editable fields, and Enter it manually offers the same four, empty.

  • Pro

    An AI assistant's empty history in a framed window: the sidebar says No chats yet, a drawing of three stacked speech cards and four prompt chips lead to a log and composer with sample replies.