复制一段给 AI 编程工具的提示词,包含源码、依赖和用法
属性
AlertProps
同时支持以下类型的全部属性: Omit<React.ComponentProps<"div">, "title">
| 属性 | 类型 | 默认值 | 说明 |
|---|---|---|---|
| variant | AlertVariant | "info" | — |
| title | React.ReactNode | — | — |
| description | React.ReactNode | — | — |
| dismissible | boolean | false | Shows a dismiss button. The alert hides itself and calls `onDismiss`. |
| onDismiss | () => void | — | — |
| action | React.ReactNode | — | Optional action, e.g. a button or link, rendered under the text. |
安装
$ npx shadcn@latest add https://chromotion.dev/r/alert.json