外观
Alert 提示框
在页面中就地呈现需要留意的状态和说明,例如编辑权限或归档结果。
import { SAlert } from '@icecreamqaq/shadcn/alert'使用示例
常用 API
| 成员 | 类型 | 用法 |
|---|---|---|
SAlert.variant | "default" | "destructive" | 默认用于普通提示,destructive 用于强调风险或错误。 |
SAlertTitle | 默认插槽 | 提供简明的提示标题。 |
SAlertDescription | 默认插槽 | 填写状态详情、原因或下一步操作说明。 |
SAlert 根元素带有 role="alert"。需要用户显式确认的操作可使用 SAlert SDialog。
完整 API
Alert9 个成员
属性
| 名称 | 类型 |
|---|---|
title | RenderContent |
description | RenderContent |
icon | RenderContent |
class | ClassValue |
variant | "default" | "destructive" | null |
插槽
| 名称 | 类型 |
|---|---|
default | ((props: {}) => any) |
icon | ((props: {}) => any) |
title | ((props: {}) => any) |
description | ((props: {}) => any) |
AlertDescription2 个成员
属性
| 名称 | 类型 |
|---|---|
class | ClassValue |
插槽
| 名称 | 类型 |
|---|---|
default | ((props: {}) => any) |
AlertTitle2 个成员
属性
| 名称 | 类型 |
|---|---|
class | ClassValue |
插槽
| 名称 | 类型 |
|---|---|
default | ((props: {}) => any) |
分组导出
模板标签为 <s-alert>。
组件 SAlert、SAlertDescription、SAlertTitle
函数与常量 alertVariants
类型 AlertVariants