Atelier UI

搜索组件…

搜索组件…

Announcement Bar

可关闭的顶部公告横幅,含徽标、文案、箭头链接和关闭按钮。

在沙盒中编辑

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

属性

AnnouncementBarProps

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

属性类型默认值说明
badgestring"New"—
message* 必填React.ReactNode——
linkLabelstring"Learn more"—
hrefstring"#"—
dismissedboolean—Controlled dismissed state
onDismiss() => void—Called when the user closes the bar

安装

$ npx shadcn@latest add https://chromotion.dev/r/announcement-bar.json

同类组件