PeakUIPro

ChatListView

Thread list rows for chat sidebars and conversation pickers

Usage

ChatListView renders recent conversations or saved threads. Each row is a button, or a link through render.

import {ChatListView} from "@peakui-pro/react";

Anatomy

import {ChatListView} from "@peakui-pro/react";

export default () => (
  <ChatListView aria-label="Recent chats">
    <ChatListView.Item>
      <ChatListView.Icon>{icon}</ChatListView.Icon>
      <ChatListView.ItemContent>
        <ChatListView.Title>Project planning</ChatListView.Title>
        <ChatListView.Preview>The last assistant reply</ChatListView.Preview>
        <ChatListView.Meta>2h ago</ChatListView.Meta>
      </ChatListView.ItemContent>
    </ChatListView.Item>
  </ChatListView>
);

Examples

Compact

density="compact" keeps the icon and the title and drops the preview and the metadata, for a narrow sidebar.

Parts

PartDescription
ChatListViewRoot list. Native div props and density: comfortable (default) or compact.
ChatListView.ItemThread row. The core Button props; render turns it into a link.
ChatListView.IconLeading icon or avatar.
ChatListView.ItemContentWraps the text.
ChatListView.TitleThread title.
ChatListView.PreviewLast-message preview.
ChatListView.MetaOptional metadata: a date or an unread count.

CSS Classes

.chat-list-view, .chat-list-view__item, .chat-list-view__icon, .chat-list-view__item-content, .chat-list-view__title, .chat-list-view__preview, .chat-list-view__meta.

On this page