Atelier UI

搜索组件…

搜索组件…

Star Button

点赞/收藏切换按钮,点击时星星弹簧缩放并迸发粒子,计数同步变化。

在沙盒中编辑

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

属性

StarButtonProps

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

属性类型默认值说明
defaultPressedbooleanfalse—
onPressedChange(pressed: boolean) => void——
countnumber128Base count shown next to the star

安装

$ npx shadcn@latest add https://chromotion.dev/r/star-button.json

同类组件