"use client"
import { useEffect, useState } from "react"
import { useTheme } from "next-themes"
import { StarButton } from "@/components/ui/star-button"
export function StarButtonDemo() {
const { theme } = useTheme()
const [lightColor, setLightColor] = useState("#FAFAFA")
useEffect(() => {
setLightColor(theme === "dark" ? "#FAFAFA" : "#FF2056")
}, [theme])
return (
<div>
<StarButton lightColor={lightColor} className="rounded-3xl">
Hover me
</StarButton>
</div>
)
}
pnpm dlx shadcn@latest add https://badtz-ui.com/r/star-button.json
import { StarButton } from "@/components/ui/star-button";
<StarButton className="rounded-3xl">Hover me</StarButton>
StarButton
props.
Prop | Type | Default |
---|---|---|
children | ReactNode | - |
lightWidth? | number | 110 |
duration? | number | 3 |
lightColor? | string | "#FAFAFA" |
backgroundColor? | string | "currentColor" |
borderWidth? | number | 2 |
className? | string | - |
On This Page