Chat List UI for React
A React chat list UI for a messaging app, with search, filters with counts, pinned chats, presence and unread badges.
npx shadcn@latest add https://lokendra-builds.github.io/sheenui/r/chat.jsonRecent chats
Arrow keys move between chats, Enter opens one, Shift+F10 shows its actions.
ConversationListChatAvatarPresenceDotUnreadBadge- +2 more
Inbox
Arrow keys move between chats, Enter opens one, typing a name jumps to it and Shift+F10 opens a chat's actions. On a phone, swipe a row to the left. Turn on 1,200 more chats to feel the windowing.
Chats
Arrow keys move between chats, Enter opens one, Shift+F10 shows its actions.
import { useState } from "react";
import { ConversationList } from "@/components/sheenui/chat/conversation-list";
import { type ChatConversation, type ChatConversationAction, type ChatParticipant } from "@/components/sheenui/chat/types";
// Package build (after the first npm release, or a packed tarball): import { ConversationList, type ChatConversation, type ChatConversationAction, type ChatParticipant } from "@sheenui/theme";
// Your data layer: replace these with real data and handlers.
declare const conversations: ChatConversation[];
declare const people: ChatParticipant[];
declare const api: { updateChat(id: string, action: ChatConversationAction): void };
export function Example() {
const [openId, setOpenId] = useState<string | undefined>();
return (
<ConversationList
conversations={conversations}
participants={people}
currentUserId="me"
selectedId={openId}
onSelect={(chat) => setOpenId(chat.id)}
onAction={(chat, action) => api.updateChat(chat.id, action)} // pin, mute, archive, markReadβ¦
locale="en-US"
className="h-[36rem]"
/>
);
}Files to copy
19 folders Β· 32 files Β· 4 packages
- From
theme/src/ components/chat/{conversation-list.tsx, types.ts, chat-parts.tsx, emoji.ts, format.ts, hooks.ts, icons.tsx, labels.ts, message-parts.tsx}components/avatar/components/chat/conversation-list/components/context-menu/components/dialog/components/drawer/parts/sheet.tsxcomponents/empty-state/components/file-upload/file-utils.tscomponents/input/components/kbd/components/menu/components/segmented/components/skeleton/components/spinner/components/status-icons/hooks/{use-controllable.ts, use-direction.ts, use-latest.ts, use-media-query.ts, use-preferences.ts}motion/{gate.ts, presets.ts, tokens.ts}lib/{cn.ts, field-size.ts, form.ts, glide-highlight.tsx, heading.ts, initials.ts, modal-flag.ts, modal-tab-trap.ts, popup-a11y.ts, popup-motion.ts, state-light.tsx, uid.ts, warn-once.ts}styles/
- shadcn CLI
npx shadcn@latest add https://lokendra-builds.github.io/sheenui/r/chat.jsonRegistry item: chat. The styles need the Tailwind v4 glass UI setup.- Packages
pnpm add @base-ui/react clsx motion tailwind-merge
Compact, no filters
A narrower sidebar: compact rows, the heading hidden (it still names the list), and German labels with dates from Intl.
Unterhaltungen
Arrow keys move between chats, Enter opens one, Shift+F10 shows its actions.
import { ConversationList } from "@/components/sheenui/chat/conversation-list";
import { type ChatConversation, type ChatParticipant } from "@/components/sheenui/chat/types";
// Package build (after the first npm release, or a packed tarball): import { ConversationList, type ChatConversation, type ChatParticipant } from "@sheenui/theme";
// Your data layer: replace these with real data and handlers.
declare const conversations: ChatConversation[];
declare const people: ChatParticipant[];
export function Example() {
return (
<ConversationList
conversations={conversations}
participants={people}
currentUserId="me"
density="compact"
showFilters={false}
title={false}
locale="de-DE"
labels={{ chats: "Unterhaltungen", search: "Unterhaltungen durchsuchen", searchPlaceholder: "Suchen", youPrefix: "Du:", pinnedSection: "Angeheftet", allSection: "Alle Chats", justNow: "jetzt", typing: () => "schreibtβ¦" }}
/>
);
}Props
ChatLabels keys and English defaults (140)
ChatAvatar props
PresenceDot props
UnreadBadge props
Keyboard
Accessibility
- A single-select listbox: aria-selected marks the open chat, and each row reads as name, last message, time, unread count and state.
- Rows say their position (aria-posinset, aria-setsize) even when the list is windowed. Filter and search results are announced politely.
- The swipe and "more" buttons are shortcuts to the same menu, so nothing is gesture-only. Presence is written in words.
When to use the chat list
- Use it as a messaging inbox UI, the sidebar of a messaging app or customer inbox, with search that filters and highlights, All, Unread, Groups and Archived tabs with counts, and Pinned and All chats sections.
- Use it for a support dashboard with thousands of conversations, since above windowThreshold, 150 rows by default, only the visible rows are rendered while positions are still announced.
- Use onAction for pin, mute, archive and mark as read, which appear in a menu, on right-click and long-press, and as swipe actions on touch screens.
- Skip it for a short list of static links; Vertical nav is simpler, and a Data table fits when users need sortable columns and bulk actions instead of conversation previews.
- Pair it with Chat view for the open conversation, Popover chat for a support widget, and Avatar presence dots, which the rows already use for online, away and offline.
Frequently asked questions
Related pages
67 components pages in all: browse them on All components.
By Lokendra Singh Rathore (GitHub, opens in a new tab). Published , updated .