外观
Bubble 消息气泡
按照发送方区分气泡的对齐方式和外观,连续气泡可放入一个 SBubbleGroup。
import { SBubble } from '@icecreamqaq/shadcn/bubble'使用示例
常用 API
| 成员 | 类型 | 用法 |
|---|---|---|
SBubble.align | "start" | "end" | 默认为 start。end 可以在纵向布局中将气泡靠末端排列。 |
SBubble.variant | BubbleVariants["variant"] | 支持 default、secondary、muted、tinted、outline、ghost 和 destructive。 |
SBubbleContent.as | PrimitiveProps["as"] | 默认使用 div。需要可点击气泡时可以改用 button。 |
SBubbleReactions.side | "top" | "bottom" | 将回应置于气泡上方或下方,默认 bottom。 |
完整 API
Bubble6 个成员
属性
| 名称 | 类型 |
|---|---|
variant | "default" | "destructive" | "outline" | "secondary" | "ghost" | "muted" | "tinted" | null |
align | "start" | "end" |
class | ClassValue |
asChild | boolean |
as | AsTag | Component |
插槽
| 名称 | 类型 |
|---|---|
default | ((props: {}) => any) |
BubbleContent4 个成员
属性
| 名称 | 类型 |
|---|---|
class | ClassValue |
asChild | boolean |
as | AsTag | Component |
插槽
| 名称 | 类型 |
|---|---|
default | ((props: {}) => any) |
BubbleGroup4 个成员
属性
| 名称 | 类型 |
|---|---|
class | ClassValue |
asChild | boolean |
as | AsTag | Component |
插槽
| 名称 | 类型 |
|---|---|
default | ((props: {}) => any) |
BubbleReactions6 个成员
属性
| 名称 | 类型 |
|---|---|
side | "top" | "bottom" | null |
align | "start" | "end" | null |
class | ClassValue |
asChild | boolean |
as | AsTag | Component |
插槽
| 名称 | 类型 |
|---|---|
default | ((props: {}) => any) |
分组导出
模板标签为 <s-bubble>。
组件 SBubble、SBubbleContent、SBubbleGroup、SBubbleReactions
函数与常量 bubbleReactionsVariants、bubbleVariants
类型 BubbleReactionsVariants、BubbleVariants