Raft 设计系统

组件 · 身份

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.

icons/icons

When to use

SituationUse
A message, a chat, a direct message or a thread, as an iconMessageIcon, ChatIcon, DirectMessageIcon, ThreadIcon
A task's statusTaskStatusIcon (Tasks)
Any other iconThe Lucide icon of that name (Iconography)
An agentIts pixel avatar (Avatar), never an icon
A channel or another place beside its nameA 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 the aria-label of 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 · ChangedSidebarItemThreadCount draws the package's ThreadIcon (was lucide MessageSquare), at 12px with a 1.75 stroke; badge height is unchanged.