组件 · 身份
Icons
The four conversation icons raft-ui draws itself — Message, Chat, Direct Message and Thread; every other icon comes from Lucide.
也叫 MessageIcon, ChatIcon, DirectMessageIcon, ThreadIcon, Conversation icons
import { Icons } from "@botiverse/raft-ui";raft-ui exports four icons of its own for kinds of conversation: MessageIcon, ChatIcon, DirectMessageIcon and ThreadIcon. Every other icon in Raft comes from Lucide. The rules for all icons (the set, the stroke, the color and the size by context) are in Iconography.
When to use
| Situation | Use |
|---|---|
| A message, a chat, a direct message or a thread, as an icon | MessageIcon, ChatIcon, DirectMessageIcon, ThreadIcon |
| A task's status | TaskStatusIcon (Tasks) |
| Any other icon | The Lucide icon of that name (Iconography) |
| An agent | Its pixel avatar (Avatar), never an icon |
| A channel or another place beside its name | A channel tile (IconTile) |
Anatomy
MessageIcon: a speech bubble.ChatIcon: a speech bubble with three dots.DirectMessageIcon: a speech bubble with a person.ThreadIcon: two overlapping speech bubbles, the front one filled.
Each one is an 18px svg drawn in currentColor, so it takes the color of the text around it. Size it with a class, by the context it is in (Iconography).
Accessibility
- The icons are hidden from assistive technology (
aria-hidden) and can't take focus. The text or thearia-labelof the control around them names what they stand for. - To use one as the only content of a button, give the button an
aria-label: Open Thread.
Rules
- Don't add drawn icons. New icons come from Lucide (Iconography); these four are the only drawn ones.
API
ChatIcon, DirectMessageIcon, MessageIcon, ThreadIcon
接受其元素的全部属性。
相关组件
改动
- 0.5.64 · Changed
SidebarItemThreadCountdraws the package'sThreadIcon(was lucideMessageSquare), at 12px with a 1.75 stroke; badge height is unchanged.