用途
Shadcn UI — Alert 用于展示需要引起用户注意的提示性告警(callout alert)。根据资料说明,当需要在界面中显示警告、错误或重要消息时,可使用该组件。
主要能力
- 通过 ShadAlert 默认构造函数展示标准告警。
- 通过 ShadAlert.destructive 展示错误或破坏性操作相关的告警。
- 支持配置以下内容:
- icon:图标,可使用 LucideIcons 中的图标,例如 LucideIcons.terminal、LucideIcons.circleAlert。
- title:标题文本。
- description:描述文本。
使用方式
Primary / default(默认告警)
ShadAlert(
icon: Icon(LucideIcons.terminal),
title: Text('Heads up!'),
description: Text('You can add components to your app using the cli.'),
)
Destructive(破坏性/错误告警)
ShadAlert.destructive(
icon: Icon(LucideIcons.circleAlert),
title: Text('Error'),
description: Text('Your session has expired. Please log in again.'),
)
适用场景
- 展示警告信息。
- 展示错误提示。
- 展示需要用户关注的重要消息。
- 用于破坏性操作相关的提示。
限制
资料中未提供关于平台支持范围、依赖版本、主题定制、无障碍特性、收费或价格等方面的信息,相关内容暂未提供。