pnpm dlx shadcn@latest add @gammaui/pixel-button
import { PixelButton } from "@/components/gammaui/pixel-button"
export default function Example() {
return (
<div className="flex min-h-screen items-center justify-center bg-gray-100 dark:bg-gray-900">
<PixelButton color="#4f46e5">Click Me</PixelButton>
</div>
)
}The PixelButton dynamically creates a grid of pixel-like elements that fade in when hovered, creating a retro-styled button effect.
| Prop | Type | Default | Description |
|---|---|---|---|
| children | React.ReactNode | — | The content (text or elements) inside the button. |
| color | string | '#ff5722' | The main color used for the pixel background animation. |
<PixelButton color="#22c55e">Success</PixelButton>
<PixelButton color="#3b82f6">Primary</PixelButton>
<PixelButton color="#ef4444">Danger</PixelButton><div className="grid grid-cols-3 gap-4">
<PixelButton color="#f97316">Play</PixelButton>
<PixelButton color="#10b981">Save</PixelButton>
<PixelButton color="#6366f1">Next</PixelButton>
</div>color prop.w-[180px] h-[60px]).