Pro Button

A high-impact call-to-action with a signature pixel icon and premium finish.

Framer Component

Kinetic Grid

An interactive grid that reacts to
cursor and clicks.

TSX
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
"use client"; import { cn } from "@/lib/utils"; import { useState, useEffect } from "react"; type PixelColor = "emerald" | "sky" | "rose"; type ButtonSize = "sm" | "md" | "lg"; interface ProButtonProps { text?: string; className?: string; pixelColor?: PixelColor; size?: ButtonSize; onClick?: () => void; } interface BoxProps { pixelColor: PixelColor; size: ButtonSize; } const colorMap: Record<PixelColor, string> = { rose: "bg-gradient-to-b from-[#f03030] to-[#e11d2e]", sky: "bg-gradient-to-b from-[#007bff] to-blue-600", emerald: "bg-gradient-to-b from-emerald-600 to-emerald-700", }; const sizeConfig = { sm: { button: "rounded-[16px] py-1.5 pl-1.5 pr-6 gap-4", text: "text-[16px]", box: "w-12 h-12 rounded-[10px]", pixel: "w-[4px] h-[4px]", gridGap: "gap-[3px]", shadow: "shadow-[inset_0_2px_4px_rgba(0,0,0,0.2),0_16px_20px_-5px_rgba(0,0,0,0.1),0_8px_8px_-5px_rgba(0,0,0,0.04)]", boxShadow: "shadow-[inset_0_2px_2px_rgba(255,255,255,0.5),0_8px_12px_rgba(0,0,0,0.35)]", }, md: { button: "rounded-[20px] py-1.5 pl-1.5 pr-10 gap-8", text: "text-[22px]", box: "w-16 h-16 rounded-[14px]", pixel: "w-[5px] h-[5px]", gridGap: "gap-[4px]", shadow: "shadow-[inset_0_2px_4px_rgba(0,0,0,0.2),0_20px_25px_-5px_rgba(0,0,0,0.1),0_10px_10px_-5px_rgba(0,0,0,0.04)]", boxShadow: "shadow-[inset_0_2px_2px_rgba(255,255,255,0.5),0_10px_16px_rgba(0,0,0,0.35)]", }, lg: { button: "rounded-[28px] py-2 pl-2 pr-14 gap-10", text: "text-[32px]", box: "w-24 h-24 rounded-[20px]", pixel: "w-[7px] h-[7px]", gridGap: "gap-[6px]", shadow: "shadow-[inset_0_3px_6px_rgba(0,0,0,0.25),0_25px_30px_-5px_rgba(0,0,0,0.15),0_12px_12px_-5px_rgba(0,0,0,0.06)]", boxShadow: "shadow-[inset_0_3px_3px_rgba(255,255,255,0.5),0_14px_20px_rgba(0,0,0,0.4)]", }, }; const ProButton = ({ text = "Pro Button", className, pixelColor = "sky", size = "md", onClick, }: ProButtonProps) => { const s = sizeConfig[size]; return ( <button onClick={onClick} className={cn( "relative flex items-center cursor-pointer", "bg-gradient-to-b from-[#303030] to-black", s.shadow, s.button, className, )} > <Box pixelColor={pixelColor} size={size} /> <span className={cn("text-white font-normal tracking-[0.025em]", s.text)}> {text} </span> </button> ); }; const Box = ({ pixelColor, size }: BoxProps) => { const [frame, setFrame] = useState(0); const s = sizeConfig[size]; useEffect(() => { const timer = setInterval(() => { setFrame((prev) => (prev + 1) % 9); }, 150); return () => clearInterval(timer); }, []); const getPattern = (offset: number) => { const pattern: boolean[][] = []; for (let i = 0; i < 5; i++) { const row: boolean[] = []; for (let j = 0; j < 5; j++) { const pos = j - offset; const isArrow = (i === 2 && pos >= 0 && pos <= 4) || (i === 1 && pos === 3) || (i === 0 && pos === 2) || (i === 3 && pos === 3) || (i === 4 && pos === 2); row.push(isArrow && pos >= 0 && pos <= 4); } pattern.push(row); } return pattern; }; const currentPattern = getPattern(frame - 5); return ( <div className={cn( "flex items-center justify-center", s.boxShadow, s.box, colorMap[pixelColor], )} > <div className={cn("grid grid-cols-5 grid-rows-5", s.gridGap)}> {[0, 1, 2, 3, 4].map((row) => [0, 1, 2, 3, 4].map((col) => { const isActive = currentPattern[row][col]; return ( <div key={`${row}-${col}`} className={cn( "transition-colors duration-150 ease-in", s.pixel, isActive ? "bg-white/95" : "bg-white/15", )} /> ); }), )} </div> </div> ); }; export default ProButton;

Installation

pnpm dlx shadcn@latest add @satoriui/pro-button