Skip to content

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.json

Recent chats

Riya Sharma
, Also, can you review the chat PR before that? πŸ™, Pinned, 2 unread messages
Design Crew 🎨
, Riya: Thanks Mei πŸ™Œ, Pinned
Daniel Okafor
, Just landed in Berlin ✈️
Weekend Trek ⛰️, Muted
, Ananya: Who's carrying the Maggi? 🍜, 14 unread messages
Priya Iyer
, You: Sent the invoice, let me know!, Delivered
  • ConversationList
  • ChatAvatar
  • PresenceDot
  • UnreadBadge
  • +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

Riya Sharma
, Also, can you review the chat PR before that? πŸ™, Pinned, 2 unread messages
Design Crew 🎨
, Riya: Thanks Mei πŸ™Œ, Pinned
Daniel Okafor
, typing…, 1 unread message
Weekend Trek ⛰️, Muted
, Ananya: Who's carrying the Maggi? 🍜, 14 unread messages
Priya Iyer
, You: Sent the invoice, let me know!, Delivered
Arjun Nair
, Draft: Can you send the specs
Sofia GarcΓ­a
, Β‘Gracias! See you on Friday πŸŽ‰
Family 🏑
, Vikram: Photo, 128 unread messages
Mei Lin
, You: That works πŸ‘, Read
Lucas Moreau
, Merci beaucoup!
Ishaan Kapoor
, This message was deleted
Fatima Zahra
, You: Happy birthday Fatima! πŸŽ‚πŸŽˆ, Read

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.tsx
  • components/empty-state/
  • components/file-upload/file-utils.ts
  • components/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

Riya Sharma
, Also, can you review the chat PR before that? πŸ™, Pinned, 2 unread messages
Design Crew 🎨
, Riya: Thanks Mei πŸ™Œ, Pinned
Daniel Okafor
, schreibt…, 1 unread message
Weekend Trek ⛰️, Muted
, Ananya: Who's carrying the Maggi? 🍜, 14 unread messages
Priya Iyer
, Du: Sent the invoice, let me know!, Delivered
Arjun Nair
, Draft: Can you send the specs
Sofia GarcΓ­a
, Β‘Gracias! See you on Friday πŸŽ‰
Family 🏑
, Vikram: Photo, 128 unread messages
Mei Lin
, Du: That works πŸ‘, Read
Lucas Moreau
, Merci beaucoup!
Ishaan Kapoor
, This message was deleted
Fatima Zahra
, Du: Happy birthday Fatima! πŸŽ‚πŸŽˆ, Read

Props

PropTypeDefaultDescription
conversations (required)ChatConversation[]NoneThe chats to list (any order: pinned first, then newest activity).
participants (required)ChatParticipant[]NoneEveryone who can appear: names, avatars and presence come from here.
currentUserId (required)stringNoneYour id (to name direct chats after the other person, and to mark your own last message).
selectedIdstring | nullnullThe open chat: marked as selected (aria-selected).
onSelect((conversation: ChatConversation, via: "pointer" | "keyboard") => void)NoneA row was opened (click, tap, Enter or Space). via tells keyboard from pointer, to move focus sensibly.
onAction((conversation: ChatConversation, action: ChatConversationAction) => void)NonePin, mute, archive, mark read… from the β‹― menu, right-click, long-press or a swipe. Leave out to hide them.
filterChatListFilterNoneThe active filter: "all", "unread", "groups" or "archived" (controlled).
defaultFilterChatListFilter"all"The filter on mount (uncontrolled).
onFilterChange((filter: ChatListFilter) => void)NoneCalled with the new filter.
querystringNoneSets the search text when controlled.
defaultQuerystring""The search text on mount (uncontrolled).
onQueryChange((query: string) => void)NoneCalled with the search text as it changes.
loadingbooleanfalseShows skeleton rows while the list loads.
titleReactNode"Chats"Heading above the list (defaults to "Chats"); false hides it (it stays the list's name).
headingLevelHeadingLevelOption2Level of the list's heading. Pass "none" for a paragraph with no heading role (for an example).
headerActionsReactNodeNoneShows the buttons beside the heading ("New chat").
showSearchbooleantrueShow the search field.
showFiltersbooleantrueShow the All / Unread / Groups / Archived filters.
swipeActionsbooleantrueTouch: swipe a row towards the start to reveal Pin / Mute / Archive.
emptyActionReactNodeNoneUnder the "No chats yet" message (a "Start a chat" button).
density"compact" | "comfortable""comfortable"Sets the row height: 72px comfortable, 64px compact.
windowThresholdnumber150Above this many rows, only the visible ones are rendered (smooth with thousands of chats).
nowDateNoneFixes the current time used for relative dates (for tests and screenshots).
localestringNoneBCP 47 locale for times. Pass one for prerendered pages.
labelsPartial<ChatLabels>defaultChatLabelsAny UI string (i18n); see ChatLabels (every key is listed below the table). Every other string, for translation: labels={{ you: "…" }}; omitted keys keep the English of defaultChatLabels. All 140 keys of ChatLabels are listed in the key table under the props table.
classNamestringNoneAdds extra classes to the outer element.
ChatLabels keys and English defaults (140)
Pass any key in labels; the rest keep the defaults of defaultChatLabels.
KeyEnglish default
youYou
youPrefixYou:
typing(names, group) => { if (!group || names.length === 0) return "typing…"; if (names.length === 1) return `${n...
draftPrefixDraft:
attachmentSummary(kind, count) => kind === "image" ? (count === 1 ? "Photo" : `${count} photos`) : count === 1 ? "File" : `$...
deletedMessageThis message was deleted
deletedOwnMessageYou deleted this message
status{ sending: "Sending", sent: "Sent", delivered: "Delivered", read: "Read", failed: "Not delivered" }
onlineOnline
awayAway
lastSeen(relative) => `Last seen ${relative}`
members(count, online) => online > 0 ? `${plural(count, "member", "members")}, ${online} online` : plural(count, "...
justNownow
chatsChats
searchSearch chats
searchPlaceholderSearch
clearSearchClear search
filtersLabelFilter chats
filters{ all: "All", unread: "Unread", groups: "Groups", archived: "Archived" }
pinnedSectionPinned
allSectionAll chats
unreadCount(count) => plural(count, "unread message", "unread messages")
unreadOverflow99+
pinnedPinned
mutedMuted
listHintArrow keys move between chats, Enter opens one, Shift+F10 shows its actions.
chatActions(name) => `Actions for ${name}`
pinPin
unpinUnpin
muteMute
unmuteUnmute
archiveArchive
unarchiveUnarchive
markReadMark as read
markUnreadMark as unread
loadingChatsLoading chats…
noChatsTitleNo chats yet
noChatsDescriptionWhen you start a conversation, it shows up here.
noResultsTitle(query) => `No chats match β€œ${query}”`
noResultsDescriptionCheck the spelling, or search for a name or a word from a message.
emptyFilter{ unread: "You're all caught up", groups: "No group chats yet", archived: "No archived chats" }
resultsCount(count) => plural(count, "chat", "chats")
messagesWith(title) => `Messages with ${title}`
backBack to chats
callVoice call
videoCallVideo call
contactInfoContact info
groupInfoGroup info
messageRolemessage
newMessagesNew messages
editededited
messageFrom(name, time) => `${name}, ${time}`
replyReply
reactReact
copyCopy text
copiedCopied
copyFailedCouldn't copy. Select the text and copy it instead.
editEdit
deleteDelete
messageInfoMessage info
moreActionsMore actions
retryRetry
notDeliveredNot delivered
deleteTitleDelete this message?
deleteDescriptionIt will be removed for everyone in this chat. This can't be undone.
deleteConfirmDelete for everyone
cancelCancel
closeClose
sentAtSent
deliveredAtDelivered
readAtRead
notYetNot yet
replyingTo(name) => `Replying to ${name}`
cancelReplyCancel reply
editingMessageEditing message
cancelEditCancel editing
goToQuoted(name) => `Go to the message from ${name}`
originalNotLoadedThe original message isn't loaded yet.
jumpToLatestJump to latest message
newBelow(count) => plural(count, "new message", "new messages")
loadingOlderLoading earlier messages…
beginning(title) => `This is the beginning of your chat with ${title}.`
addReactionAdd reaction
moreEmojiMore emoji
reactionChip(emoji, count, mine) => `${emoji} ${count}${mine ? ", including you" : ""}`
reactionsReactions
openImage(name) => `Open ${name}`
imageViewerPhoto
previousImagePrevious photo
nextImageNext photo
imagePosition(index, count) => `${index} of ${count}`
download(name) => `Download ${name}`
morePhotos(count) => `+${count}`
logHintUp and Down arrows move between messages. Enter shows actions, R replies, E edits your own message.
messageMessage
placeholder(title) => (title ? `Message ${title}` : "Write a message…")
sendSend
saveEditSave changes
attachAttach files
emojiEmoji
attachmentsAttachments
removeAttachment(name) => `Remove ${name}`
keyHintEnter to send, Shift + Enter for a new line, Up arrow to edit your last message
keyHintTouchUse the send button to send
editHintEsc to cancel
searchEmojiSearch emoji
noEmojiNo emoji found
emojiCategories{ smileys: "Smileys", people: "People", hearts: "Hearts", nature: "Nature", food: "Food", activities: "Acti...
announceIncoming(name, text) => `${name}: ${text}`
announceFailedMessage not delivered
announceDeletedMessage deleted
announceReaction(emoji, added) => (added ? `Reacted ${emoji}` : `Removed ${emoji}`)
announceOlderLoaded(count) => `Loaded ${plural(count, "earlier message", "earlier messages")}`
announceReplying(name) => `Replying to ${name}. Type your reply.`
announceEditingEditing your message. Press Escape to cancel.
openChatOpen chat
closeChatClose chat
minimizeMinimise chat
widgetTitleSheenUI Support
widgetSubtitleWe typically reply in a few minutes
greetingHi there πŸ‘‹
greetingDescriptionAsk us anything: we're real people and happy to help.
recentConversationsRecent conversations
sendUsMessageSend us a message
quickRepliesSuggested replies
backToHomeBack
helpHeadingFind an answer
widgetUnread(count) => plural(count, "unread message", "unread messages")
selectChatTitlePick a chat
selectChatDescriptionChoose a conversation from the list to read and reply.
aboutAbout
phonePhone
emailEmail
sharedMediaShared photos
noSharedMediaNo photos shared yet.
muteNotificationsMute notifications
unmuteNotificationsUnmute notifications
block(name) => `Block ${name}`
leaveGroupLeave group
membersHeading(count) => plural(count, "member", "members")

ChatAvatar props

PropTypeDefaultDescription
people (required)ChatParticipant[]NoneOne person (direct chat or a sender), or the group's members for a stacked group avatar.
srcstringNoneGroup photo (wins over the stack).
namestringNoneGroup name, for its initials when there is a photo but it fails to load.
size"sm" | "md" | "lg" | "xl" | "2xl""md"Diameter of the avatar: "sm" 32px, "md" 40px, "lg" 48px, "xl" 56px or "2xl" 80px.
presenceChatPresenceNoneShow this presence dot (direct chats).
classNamestringNoneAdds extra classes to the avatar.

PresenceDot props

PropTypeDefaultDescription
presence (required)ChatPresenceNone"online", "away" or "offline" (a hollow ring, so the states differ by shape too).
size"sm" | "md" | "lg" | "xl" | "2xl""md"The avatar size the dot sits on; it scales with it.
classNamestringNoneAdds extra classes to the dot.

UnreadBadge props

PropTypeDefaultDescription
count (required)numberNoneUnread messages. Zero or less renders nothing.
mutedbooleanNoneMuted chats get a quiet grey badge.
overflowstring"99+"Text shown when the count is above 99.
labelstringNoneSets the screen-reader text, e.g. "3 unread messages".
classNamestringNoneAdds extra classes to the badge.

Keyboard

KeysAction
TabThe list is one tab stop; the search field and filters are ordinary tab stops.
Arrow Up/Arrow Down, Home/End, Page Up/Page DownMove between chats.
Type a nameJump to that chat.
Enter/SpaceOpen the focused chat.
Shift + F10/Menu keyOpen the chat's actions (pin, mute, archive, mark read).

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

67 components pages in all: browse them on All components.

By Lokendra Singh Rathore (GitHub, opens in a new tab). Published , updated .