外观
Empty 空状态
没有记录时,用图标和文字说明当前状态,并给用户一个可执行的操作。
import { SEmpty } from '@icecreamqaq/shadcn/empty'使用示例
常用 API
| 成员 | 类型 | 用法 |
|---|---|---|
SEmptyMedia.variant | "default" | "icon" | icon 为图标提供统一尺寸和背景,默认值为 default。 |
SEmptyHeader.default | slot | 组合 SEmptyMedia、SEmptyTitle 和 SEmptyDescription。 |
SEmptyContent.default | slot | 放置创建、重试等能改变当前状态的操作。 |
完整 API
Empty10 个成员
属性
| 名称 | 类型 |
|---|---|
title | RenderContent |
description | RenderContent |
icon | RenderContent |
action | RenderContent |
class | ClassValue |
插槽
| 名称 | 类型 |
|---|---|
default | ((props: {}) => any) |
icon | ((props: {}) => any) |
title | ((props: {}) => any) |
description | ((props: {}) => any) |
action | ((props: {}) => any) |
EmptyContent2 个成员
属性
| 名称 | 类型 |
|---|---|
class | ClassValue |
插槽
| 名称 | 类型 |
|---|---|
default | ((props: {}) => any) |
EmptyDescription2 个成员
属性
| 名称 | 类型 |
|---|---|
class | ClassValue |
插槽
| 名称 | 类型 |
|---|---|
default | ((props: {}) => any) |
EmptyHeader2 个成员
属性
| 名称 | 类型 |
|---|---|
class | ClassValue |
插槽
| 名称 | 类型 |
|---|---|
default | ((props: {}) => any) |
EmptyMedia3 个成员
属性
| 名称 | 类型 |
|---|---|
class | ClassValue |
variant | "default" | "icon" | null |
插槽
| 名称 | 类型 |
|---|---|
default | ((props: {}) => any) |
EmptyTitle2 个成员
属性
| 名称 | 类型 |
|---|---|
class | ClassValue |
插槽
| 名称 | 类型 |
|---|---|
default | ((props: {}) => any) |
分组导出
模板标签为 <s-empty>。
组件 SEmpty、SEmptyContent、SEmptyDescription、SEmptyHeader、SEmptyMedia、SEmptyTitle
函数与常量 emptyMediaVariants
类型 EmptyMediaVariants