Atelier UI

搜索组件…

搜索组件…

Alert

带图标的内联提示条,支持信息、成功、警告、错误四种样式,可选标题、关闭按钮和操作。

在沙盒中编辑

复制一段给 AI 编程工具的提示词,包含源码、依赖和用法

属性

AlertProps

同时支持以下类型的全部属性: Omit<React.ComponentProps<"div">, "title">

属性类型默认值说明
variantAlertVariant"info"—
titleReact.ReactNode——
descriptionReact.ReactNode——
dismissiblebooleanfalseShows a dismiss button. The alert hides itself and calls `onDismiss`.
onDismiss() => void——
actionReact.ReactNode—Optional action, e.g. a button or link, rendered under the text.

安装

$ npx shadcn@latest add https://chromotion.dev/r/alert.json

同类组件