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
| Part | Description |
|---|---|
ChatListView | Root list. Native div props and density: comfortable (default) or compact. |
ChatListView.Item | Thread row. The core Button props; render turns it into a link. |
ChatListView.Icon | Leading icon or avatar. |
ChatListView.ItemContent | Wraps the text. |
ChatListView.Title | Thread title. |
ChatListView.Preview | Last-message preview. |
ChatListView.Meta | Optional 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.