@farzadbagheri/fb-components 0.1.0 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/COMPONENTS.md +1101 -0
- package/EXAMPLES.md +1064 -0
- package/LICENSE +20 -20
- package/README.md +744 -131
- package/dist/ai.cjs +3 -3
- package/dist/ai.css.map +1 -1
- package/dist/ai.js +1 -1
- package/dist/backgrounds.cjs +7 -7
- package/dist/backgrounds.css.map +1 -1
- package/dist/backgrounds.js +1 -1
- package/dist/buttons.cjs +4 -4
- package/dist/buttons.css.map +1 -1
- package/dist/buttons.js +1 -1
- package/dist/{chunk-MKCSRMHF.cjs → chunk-4YAFXF3T.cjs} +2 -2
- package/dist/chunk-4YAFXF3T.cjs.map +1 -0
- package/dist/{chunk-H2AV67DY.cjs → chunk-7PUXKRNW.cjs} +7 -5
- package/dist/chunk-7PUXKRNW.cjs.map +1 -0
- package/dist/{chunk-CTD2GDO6.cjs → chunk-B5HDPUQK.cjs} +2 -2
- package/dist/chunk-B5HDPUQK.cjs.map +1 -0
- package/dist/{chunk-K5QRX5CZ.js → chunk-ENCZZRVK.js} +2 -2
- package/dist/chunk-ENCZZRVK.js.map +1 -0
- package/dist/{chunk-H6Y3EJPA.cjs → chunk-F4XFUSPM.cjs} +2 -2
- package/dist/chunk-F4XFUSPM.cjs.map +1 -0
- package/dist/{chunk-4FWJRWS5.cjs → chunk-HPWZ5OL2.cjs} +2 -2
- package/dist/chunk-HPWZ5OL2.cjs.map +1 -0
- package/dist/{chunk-JHOJY54P.js → chunk-HSY72AJ4.js} +2 -2
- package/dist/chunk-HSY72AJ4.js.map +1 -0
- package/dist/{chunk-R2F3FTBL.js → chunk-IZJHBS5M.js} +2 -2
- package/dist/chunk-IZJHBS5M.js.map +1 -0
- package/dist/{chunk-T7CC3CLH.js → chunk-J4ZYYB2O.js} +2 -2
- package/dist/chunk-J4ZYYB2O.js.map +1 -0
- package/dist/{chunk-C3ASXASL.cjs → chunk-MWSE4C6T.cjs} +2 -2
- package/dist/chunk-MWSE4C6T.cjs.map +1 -0
- package/dist/{chunk-WDUETPNG.js → chunk-P77GGWU6.js} +7 -5
- package/dist/chunk-P77GGWU6.js.map +1 -0
- package/dist/{chunk-ROKPXWY2.cjs → chunk-QTX5BFS6.cjs} +2 -2
- package/dist/chunk-QTX5BFS6.cjs.map +1 -0
- package/dist/{chunk-YQSTEIU5.js → chunk-RFI4526D.js} +2 -2
- package/dist/chunk-RFI4526D.js.map +1 -0
- package/dist/{chunk-BSEOOGOV.cjs → chunk-SS4GAAED.cjs} +2 -2
- package/dist/chunk-SS4GAAED.cjs.map +1 -0
- package/dist/{chunk-UWQ5QNE3.cjs → chunk-TG7XM34D.cjs} +2 -2
- package/dist/chunk-TG7XM34D.cjs.map +1 -0
- package/dist/{chunk-EIE6FLCL.js → chunk-VODRAWMB.js} +2 -2
- package/dist/chunk-VODRAWMB.js.map +1 -0
- package/dist/{chunk-RUSFF3MZ.js → chunk-XJGKXWK3.js} +2 -2
- package/dist/chunk-XJGKXWK3.js.map +1 -0
- package/dist/{chunk-JWV3IITG.js → chunk-YPBGV2B5.js} +2 -2
- package/dist/chunk-YPBGV2B5.js.map +1 -0
- package/dist/data.cjs +4 -4
- package/dist/data.css.map +1 -1
- package/dist/data.d.cts +2 -1
- package/dist/data.d.ts +2 -1
- package/dist/data.js +1 -1
- package/dist/heroes.cjs +2 -2
- package/dist/heroes.css.map +1 -1
- package/dist/heroes.js +1 -1
- package/dist/index.cjs +31 -31
- package/dist/index.css.map +1 -1
- package/dist/index.js +9 -9
- package/dist/landing.cjs +2 -2
- package/dist/landing.css.map +1 -1
- package/dist/landing.js +1 -1
- package/dist/motion.cjs +3 -3
- package/dist/motion.css.map +1 -1
- package/dist/motion.js +1 -1
- package/dist/text.cjs +3 -3
- package/dist/text.css.map +1 -1
- package/dist/text.js +1 -1
- package/dist/ui.cjs +3 -3
- package/dist/ui.css.map +1 -1
- package/dist/ui.js +1 -1
- package/package.json +167 -134
- package/dist/chunk-4FWJRWS5.cjs.map +0 -1
- package/dist/chunk-BSEOOGOV.cjs.map +0 -1
- package/dist/chunk-C3ASXASL.cjs.map +0 -1
- package/dist/chunk-CTD2GDO6.cjs.map +0 -1
- package/dist/chunk-EIE6FLCL.js.map +0 -1
- package/dist/chunk-H2AV67DY.cjs.map +0 -1
- package/dist/chunk-H6Y3EJPA.cjs.map +0 -1
- package/dist/chunk-JHOJY54P.js.map +0 -1
- package/dist/chunk-JWV3IITG.js.map +0 -1
- package/dist/chunk-K5QRX5CZ.js.map +0 -1
- package/dist/chunk-MKCSRMHF.cjs.map +0 -1
- package/dist/chunk-R2F3FTBL.js.map +0 -1
- package/dist/chunk-ROKPXWY2.cjs.map +0 -1
- package/dist/chunk-RUSFF3MZ.js.map +0 -1
- package/dist/chunk-T7CC3CLH.js.map +0 -1
- package/dist/chunk-UWQ5QNE3.cjs.map +0 -1
- package/dist/chunk-WDUETPNG.js.map +0 -1
- package/dist/chunk-YQSTEIU5.js.map +0 -1
package/EXAMPLES.md
ADDED
|
@@ -0,0 +1,1064 @@
|
|
|
1
|
+
# FB Components — Usage Examples
|
|
2
|
+
|
|
3
|
+
Practical copy-paste examples for:
|
|
4
|
+
|
|
5
|
+
```text
|
|
6
|
+
@farzadbagheri/fb-components
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
This guide complements:
|
|
10
|
+
|
|
11
|
+
- `README.md`
|
|
12
|
+
- `COMPONENTS.md`
|
|
13
|
+
|
|
14
|
+
It focuses on real integration patterns, category imports, CSS strategy, React usage, TypeScript, accessibility, and common compositions.
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
# Table of Contents
|
|
19
|
+
|
|
20
|
+
1. [Installation](#installation)
|
|
21
|
+
2. [Quick Start](#quick-start)
|
|
22
|
+
3. [Buttons](#buttons)
|
|
23
|
+
4. [Backgrounds](#backgrounds)
|
|
24
|
+
5. [Text Animations](#text-animations)
|
|
25
|
+
6. [UI Cards](#ui-cards)
|
|
26
|
+
7. [Motion](#motion)
|
|
27
|
+
8. [AI Interface](#ai-interface)
|
|
28
|
+
9. [Hero Section](#hero-section)
|
|
29
|
+
10. [Startup Landing](#startup-landing)
|
|
30
|
+
11. [Dashboard Metrics](#dashboard-metrics)
|
|
31
|
+
12. [Mixed Product Section](#mixed-product-section)
|
|
32
|
+
13. [Category CSS Strategy](#category-css-strategy)
|
|
33
|
+
14. [Full Stylesheet Strategy](#full-stylesheet-strategy)
|
|
34
|
+
15. [TypeScript Example](#typescript-example)
|
|
35
|
+
16. [Vite Example](#vite-example)
|
|
36
|
+
17. [Next.js Client Component Example](#nextjs-client-component-example)
|
|
37
|
+
18. [Accessibility Examples](#accessibility-examples)
|
|
38
|
+
19. [Recommended Composition Patterns](#recommended-composition-patterns)
|
|
39
|
+
|
|
40
|
+
---
|
|
41
|
+
|
|
42
|
+
# Installation
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
npm install @farzadbagheri/fb-components
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Requirements:
|
|
49
|
+
|
|
50
|
+
```text
|
|
51
|
+
React >=18 <20
|
|
52
|
+
React DOM >=18 <20
|
|
53
|
+
Node >=18
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
---
|
|
57
|
+
|
|
58
|
+
# Quick Start
|
|
59
|
+
|
|
60
|
+
Use category imports when possible.
|
|
61
|
+
|
|
62
|
+
```tsx
|
|
63
|
+
import { GlowButton } from "@farzadbagheri/fb-components/buttons";
|
|
64
|
+
import "@farzadbagheri/fb-components/buttons.css";
|
|
65
|
+
|
|
66
|
+
export function QuickStart() {
|
|
67
|
+
return (
|
|
68
|
+
<GlowButton>
|
|
69
|
+
Launch
|
|
70
|
+
</GlowButton>
|
|
71
|
+
);
|
|
72
|
+
}
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
This keeps the CSS footprint focused on the category you use.
|
|
76
|
+
|
|
77
|
+
---
|
|
78
|
+
|
|
79
|
+
# Buttons
|
|
80
|
+
|
|
81
|
+
## GlowButton
|
|
82
|
+
|
|
83
|
+
```tsx
|
|
84
|
+
import { GlowButton } from "@farzadbagheri/fb-components/buttons";
|
|
85
|
+
import "@farzadbagheri/fb-components/buttons.css";
|
|
86
|
+
|
|
87
|
+
export function GlowButtonExample() {
|
|
88
|
+
return (
|
|
89
|
+
<GlowButton>
|
|
90
|
+
Start now
|
|
91
|
+
</GlowButton>
|
|
92
|
+
);
|
|
93
|
+
}
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
---
|
|
97
|
+
|
|
98
|
+
## GlassButton
|
|
99
|
+
|
|
100
|
+
```tsx
|
|
101
|
+
import { GlassButton } from "@farzadbagheri/fb-components/buttons";
|
|
102
|
+
import "@farzadbagheri/fb-components/buttons.css";
|
|
103
|
+
|
|
104
|
+
export function GlassButtonExample() {
|
|
105
|
+
return (
|
|
106
|
+
<GlassButton
|
|
107
|
+
tint="#9b7cff"
|
|
108
|
+
opacity={0.12}
|
|
109
|
+
blur={18}
|
|
110
|
+
radius={18}
|
|
111
|
+
>
|
|
112
|
+
Explore
|
|
113
|
+
</GlassButton>
|
|
114
|
+
);
|
|
115
|
+
}
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
---
|
|
119
|
+
|
|
120
|
+
## MagneticButton
|
|
121
|
+
|
|
122
|
+
```tsx
|
|
123
|
+
import { MagneticButton } from "@farzadbagheri/fb-components/buttons";
|
|
124
|
+
import "@farzadbagheri/fb-components/buttons.css";
|
|
125
|
+
|
|
126
|
+
export function MagneticButtonExample() {
|
|
127
|
+
return (
|
|
128
|
+
<MagneticButton>
|
|
129
|
+
View project
|
|
130
|
+
</MagneticButton>
|
|
131
|
+
);
|
|
132
|
+
}
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
---
|
|
136
|
+
|
|
137
|
+
# Backgrounds
|
|
138
|
+
|
|
139
|
+
## PredictiveArc
|
|
140
|
+
|
|
141
|
+
```tsx
|
|
142
|
+
import { PredictiveArc } from "@farzadbagheri/fb-components/backgrounds";
|
|
143
|
+
import "@farzadbagheri/fb-components/backgrounds.css";
|
|
144
|
+
|
|
145
|
+
export function PredictiveArcExample() {
|
|
146
|
+
return (
|
|
147
|
+
<div style={{ minHeight: 320 }}>
|
|
148
|
+
<PredictiveArc
|
|
149
|
+
color="#9b7cff"
|
|
150
|
+
background="#0d0d11"
|
|
151
|
+
size={82}
|
|
152
|
+
thickness={4}
|
|
153
|
+
glow={24}
|
|
154
|
+
/>
|
|
155
|
+
</div>
|
|
156
|
+
);
|
|
157
|
+
}
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
---
|
|
161
|
+
|
|
162
|
+
## SignalParticles
|
|
163
|
+
|
|
164
|
+
```tsx
|
|
165
|
+
import { SignalParticles } from "@farzadbagheri/fb-components/backgrounds";
|
|
166
|
+
import "@farzadbagheri/fb-components/backgrounds.css";
|
|
167
|
+
|
|
168
|
+
export function SignalParticlesExample() {
|
|
169
|
+
return (
|
|
170
|
+
<div style={{ minHeight: 360 }}>
|
|
171
|
+
<SignalParticles />
|
|
172
|
+
</div>
|
|
173
|
+
);
|
|
174
|
+
}
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
---
|
|
178
|
+
|
|
179
|
+
## DotMatrix
|
|
180
|
+
|
|
181
|
+
```tsx
|
|
182
|
+
import { DotMatrix } from "@farzadbagheri/fb-components/backgrounds";
|
|
183
|
+
import "@farzadbagheri/fb-components/backgrounds.css";
|
|
184
|
+
|
|
185
|
+
export function DotMatrixExample() {
|
|
186
|
+
return (
|
|
187
|
+
<div style={{ minHeight: 320 }}>
|
|
188
|
+
<DotMatrix />
|
|
189
|
+
</div>
|
|
190
|
+
);
|
|
191
|
+
}
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
---
|
|
195
|
+
|
|
196
|
+
## GradientMesh
|
|
197
|
+
|
|
198
|
+
```tsx
|
|
199
|
+
import { GradientMesh } from "@farzadbagheri/fb-components/backgrounds";
|
|
200
|
+
import "@farzadbagheri/fb-components/backgrounds.css";
|
|
201
|
+
|
|
202
|
+
export function GradientMeshExample() {
|
|
203
|
+
return (
|
|
204
|
+
<div style={{ minHeight: 360 }}>
|
|
205
|
+
<GradientMesh />
|
|
206
|
+
</div>
|
|
207
|
+
);
|
|
208
|
+
}
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
---
|
|
212
|
+
|
|
213
|
+
## AuroraGrid
|
|
214
|
+
|
|
215
|
+
```tsx
|
|
216
|
+
import { AuroraGrid } from "@farzadbagheri/fb-components/backgrounds";
|
|
217
|
+
import "@farzadbagheri/fb-components/backgrounds.css";
|
|
218
|
+
|
|
219
|
+
export function AuroraGridExample() {
|
|
220
|
+
return (
|
|
221
|
+
<div style={{ minHeight: 360 }}>
|
|
222
|
+
<AuroraGrid />
|
|
223
|
+
</div>
|
|
224
|
+
);
|
|
225
|
+
}
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
---
|
|
229
|
+
|
|
230
|
+
## NoiseField
|
|
231
|
+
|
|
232
|
+
```tsx
|
|
233
|
+
import { NoiseField } from "@farzadbagheri/fb-components/backgrounds";
|
|
234
|
+
import "@farzadbagheri/fb-components/backgrounds.css";
|
|
235
|
+
|
|
236
|
+
export function NoiseFieldExample() {
|
|
237
|
+
return (
|
|
238
|
+
<div style={{ minHeight: 300 }}>
|
|
239
|
+
<NoiseField />
|
|
240
|
+
</div>
|
|
241
|
+
);
|
|
242
|
+
}
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
---
|
|
246
|
+
|
|
247
|
+
# Text Animations
|
|
248
|
+
|
|
249
|
+
## RevealText
|
|
250
|
+
|
|
251
|
+
```tsx
|
|
252
|
+
import { RevealText } from "@farzadbagheri/fb-components/text";
|
|
253
|
+
import "@farzadbagheri/fb-components/text.css";
|
|
254
|
+
|
|
255
|
+
export function RevealTextExample() {
|
|
256
|
+
return (
|
|
257
|
+
<RevealText>
|
|
258
|
+
Build better interfaces.
|
|
259
|
+
</RevealText>
|
|
260
|
+
);
|
|
261
|
+
}
|
|
262
|
+
```
|
|
263
|
+
|
|
264
|
+
---
|
|
265
|
+
|
|
266
|
+
## BlurReveal
|
|
267
|
+
|
|
268
|
+
```tsx
|
|
269
|
+
import { BlurReveal } from "@farzadbagheri/fb-components/text";
|
|
270
|
+
import "@farzadbagheri/fb-components/text.css";
|
|
271
|
+
|
|
272
|
+
export function BlurRevealExample() {
|
|
273
|
+
return (
|
|
274
|
+
<BlurReveal>
|
|
275
|
+
Ship faster.
|
|
276
|
+
</BlurReveal>
|
|
277
|
+
);
|
|
278
|
+
}
|
|
279
|
+
```
|
|
280
|
+
|
|
281
|
+
---
|
|
282
|
+
|
|
283
|
+
# UI Cards
|
|
284
|
+
|
|
285
|
+
## GlassCard
|
|
286
|
+
|
|
287
|
+
```tsx
|
|
288
|
+
import { GlassCard } from "@farzadbagheri/fb-components/ui";
|
|
289
|
+
import "@farzadbagheri/fb-components/ui.css";
|
|
290
|
+
|
|
291
|
+
export function GlassCardExample() {
|
|
292
|
+
return (
|
|
293
|
+
<GlassCard>
|
|
294
|
+
<h3>Project status</h3>
|
|
295
|
+
<p>All systems operational.</p>
|
|
296
|
+
</GlassCard>
|
|
297
|
+
);
|
|
298
|
+
}
|
|
299
|
+
```
|
|
300
|
+
|
|
301
|
+
---
|
|
302
|
+
|
|
303
|
+
## SpotlightCard
|
|
304
|
+
|
|
305
|
+
```tsx
|
|
306
|
+
import { SpotlightCard } from "@farzadbagheri/fb-components/ui";
|
|
307
|
+
import "@farzadbagheri/fb-components/ui.css";
|
|
308
|
+
|
|
309
|
+
export function SpotlightCardExample() {
|
|
310
|
+
return (
|
|
311
|
+
<SpotlightCard>
|
|
312
|
+
<h3>AI Platform</h3>
|
|
313
|
+
<p>Build modern AI experiences.</p>
|
|
314
|
+
</SpotlightCard>
|
|
315
|
+
);
|
|
316
|
+
}
|
|
317
|
+
```
|
|
318
|
+
|
|
319
|
+
---
|
|
320
|
+
|
|
321
|
+
# Motion
|
|
322
|
+
|
|
323
|
+
## GlowCursor
|
|
324
|
+
|
|
325
|
+
```tsx
|
|
326
|
+
import { GlowCursor } from "@farzadbagheri/fb-components/motion";
|
|
327
|
+
import "@farzadbagheri/fb-components/motion.css";
|
|
328
|
+
|
|
329
|
+
export function GlowCursorExample() {
|
|
330
|
+
return (
|
|
331
|
+
<GlowCursor>
|
|
332
|
+
<section
|
|
333
|
+
style={{
|
|
334
|
+
minHeight: 280,
|
|
335
|
+
display: "grid",
|
|
336
|
+
placeItems: "center",
|
|
337
|
+
}}
|
|
338
|
+
>
|
|
339
|
+
<button type="button">
|
|
340
|
+
Hover here
|
|
341
|
+
</button>
|
|
342
|
+
</section>
|
|
343
|
+
</GlowCursor>
|
|
344
|
+
);
|
|
345
|
+
}
|
|
346
|
+
```
|
|
347
|
+
|
|
348
|
+
---
|
|
349
|
+
|
|
350
|
+
## MagneticCursor
|
|
351
|
+
|
|
352
|
+
```tsx
|
|
353
|
+
import { MagneticCursor } from "@farzadbagheri/fb-components/motion";
|
|
354
|
+
import "@farzadbagheri/fb-components/motion.css";
|
|
355
|
+
|
|
356
|
+
export function MagneticCursorExample() {
|
|
357
|
+
return (
|
|
358
|
+
<MagneticCursor
|
|
359
|
+
color="#b99cff"
|
|
360
|
+
size={18}
|
|
361
|
+
ringSize={44}
|
|
362
|
+
magneticStrength={0.25}
|
|
363
|
+
>
|
|
364
|
+
<div
|
|
365
|
+
style={{
|
|
366
|
+
minHeight: 320,
|
|
367
|
+
display: "grid",
|
|
368
|
+
placeItems: "center",
|
|
369
|
+
}}
|
|
370
|
+
>
|
|
371
|
+
<button
|
|
372
|
+
type="button"
|
|
373
|
+
data-magnetic-target
|
|
374
|
+
>
|
|
375
|
+
Explore
|
|
376
|
+
</button>
|
|
377
|
+
</div>
|
|
378
|
+
</MagneticCursor>
|
|
379
|
+
);
|
|
380
|
+
}
|
|
381
|
+
```
|
|
382
|
+
|
|
383
|
+
Use:
|
|
384
|
+
|
|
385
|
+
```tsx
|
|
386
|
+
data-magnetic-target
|
|
387
|
+
```
|
|
388
|
+
|
|
389
|
+
on any element that should attract the custom cursor.
|
|
390
|
+
|
|
391
|
+
---
|
|
392
|
+
|
|
393
|
+
# AI Interface
|
|
394
|
+
|
|
395
|
+
## Prompt Composer
|
|
396
|
+
|
|
397
|
+
```tsx
|
|
398
|
+
import { AiPromptBox } from "@farzadbagheri/fb-components/ai";
|
|
399
|
+
import "@farzadbagheri/fb-components/ai.css";
|
|
400
|
+
|
|
401
|
+
export function AiPromptExample() {
|
|
402
|
+
return (
|
|
403
|
+
<AiPromptBox
|
|
404
|
+
modelLabel="FB AI · Fast"
|
|
405
|
+
placeholder="Describe your task"
|
|
406
|
+
onSubmit={(value) => {
|
|
407
|
+
console.log("Prompt:", value);
|
|
408
|
+
}}
|
|
409
|
+
/>
|
|
410
|
+
);
|
|
411
|
+
}
|
|
412
|
+
```
|
|
413
|
+
|
|
414
|
+
---
|
|
415
|
+
|
|
416
|
+
## Prompt + Response
|
|
417
|
+
|
|
418
|
+
```tsx
|
|
419
|
+
import {
|
|
420
|
+
AiPromptBox,
|
|
421
|
+
StreamingResponse,
|
|
422
|
+
} from "@farzadbagheri/fb-components/ai";
|
|
423
|
+
|
|
424
|
+
import "@farzadbagheri/fb-components/ai.css";
|
|
425
|
+
|
|
426
|
+
export function AiWorkspace() {
|
|
427
|
+
return (
|
|
428
|
+
<div
|
|
429
|
+
style={{
|
|
430
|
+
display: "grid",
|
|
431
|
+
gap: 24,
|
|
432
|
+
maxWidth: 760,
|
|
433
|
+
margin: "0 auto",
|
|
434
|
+
}}
|
|
435
|
+
>
|
|
436
|
+
<AiPromptBox
|
|
437
|
+
placeholder="Ask anything..."
|
|
438
|
+
onSubmit={(value) => {
|
|
439
|
+
console.log(value);
|
|
440
|
+
}}
|
|
441
|
+
/>
|
|
442
|
+
|
|
443
|
+
<StreamingResponse />
|
|
444
|
+
</div>
|
|
445
|
+
);
|
|
446
|
+
}
|
|
447
|
+
```
|
|
448
|
+
|
|
449
|
+
---
|
|
450
|
+
|
|
451
|
+
# Hero Section
|
|
452
|
+
|
|
453
|
+
```tsx
|
|
454
|
+
import { SaasLaunchHero } from "@farzadbagheri/fb-components/heroes";
|
|
455
|
+
import "@farzadbagheri/fb-components/heroes.css";
|
|
456
|
+
|
|
457
|
+
export function HeroExample() {
|
|
458
|
+
return (
|
|
459
|
+
<SaasLaunchHero
|
|
460
|
+
eyebrow="BUILT FOR MODERN TEAMS"
|
|
461
|
+
title={"Ship faster.\nScale smarter."}
|
|
462
|
+
description="Everything your team needs to launch, learn and scale."
|
|
463
|
+
primaryLabel="Start free"
|
|
464
|
+
secondaryLabel="See demo"
|
|
465
|
+
showSecondary
|
|
466
|
+
showProof
|
|
467
|
+
/>
|
|
468
|
+
);
|
|
469
|
+
}
|
|
470
|
+
```
|
|
471
|
+
|
|
472
|
+
Minimal version:
|
|
473
|
+
|
|
474
|
+
```tsx
|
|
475
|
+
<SaasLaunchHero
|
|
476
|
+
title="Launch your next product."
|
|
477
|
+
showSecondary={false}
|
|
478
|
+
showProof={false}
|
|
479
|
+
/>
|
|
480
|
+
```
|
|
481
|
+
|
|
482
|
+
---
|
|
483
|
+
|
|
484
|
+
# Startup Landing
|
|
485
|
+
|
|
486
|
+
```tsx
|
|
487
|
+
import { StartupLanding } from "@farzadbagheri/fb-components/landing";
|
|
488
|
+
import "@farzadbagheri/fb-components/landing.css";
|
|
489
|
+
|
|
490
|
+
export function StartupLandingExample() {
|
|
491
|
+
return (
|
|
492
|
+
<StartupLanding
|
|
493
|
+
accent="#7d63ff"
|
|
494
|
+
background="#08080c"
|
|
495
|
+
radius={20}
|
|
496
|
+
showMetrics
|
|
497
|
+
showFeatures
|
|
498
|
+
/>
|
|
499
|
+
);
|
|
500
|
+
}
|
|
501
|
+
```
|
|
502
|
+
|
|
503
|
+
Minimal version:
|
|
504
|
+
|
|
505
|
+
```tsx
|
|
506
|
+
<StartupLanding
|
|
507
|
+
showMetrics={false}
|
|
508
|
+
showFeatures={false}
|
|
509
|
+
/>
|
|
510
|
+
```
|
|
511
|
+
|
|
512
|
+
---
|
|
513
|
+
|
|
514
|
+
# Dashboard Metrics
|
|
515
|
+
|
|
516
|
+
```tsx
|
|
517
|
+
import {
|
|
518
|
+
AnimatedCounter,
|
|
519
|
+
MetricGrid,
|
|
520
|
+
RadialProgress,
|
|
521
|
+
} from "@farzadbagheri/fb-components/data";
|
|
522
|
+
|
|
523
|
+
import "@farzadbagheri/fb-components/data.css";
|
|
524
|
+
|
|
525
|
+
export function DashboardMetrics() {
|
|
526
|
+
return (
|
|
527
|
+
<section
|
|
528
|
+
style={{
|
|
529
|
+
display: "grid",
|
|
530
|
+
gap: 24,
|
|
531
|
+
}}
|
|
532
|
+
>
|
|
533
|
+
<AnimatedCounter
|
|
534
|
+
value={128}
|
|
535
|
+
suffix="K"
|
|
536
|
+
label="ACTIVE USERS"
|
|
537
|
+
delta="+18.4%"
|
|
538
|
+
/>
|
|
539
|
+
|
|
540
|
+
<RadialProgress
|
|
541
|
+
value={72}
|
|
542
|
+
label="COMPLETE"
|
|
543
|
+
ariaLabel="Profile completion"
|
|
544
|
+
/>
|
|
545
|
+
|
|
546
|
+
<MetricGrid />
|
|
547
|
+
</section>
|
|
548
|
+
);
|
|
549
|
+
}
|
|
550
|
+
```
|
|
551
|
+
|
|
552
|
+
---
|
|
553
|
+
|
|
554
|
+
## AnimatedCounter
|
|
555
|
+
|
|
556
|
+
```tsx
|
|
557
|
+
import { AnimatedCounter } from "@farzadbagheri/fb-components/data";
|
|
558
|
+
import "@farzadbagheri/fb-components/data.css";
|
|
559
|
+
|
|
560
|
+
export function RevenueCounter() {
|
|
561
|
+
return (
|
|
562
|
+
<AnimatedCounter
|
|
563
|
+
value={12.35}
|
|
564
|
+
prefix="$"
|
|
565
|
+
suffix="M"
|
|
566
|
+
decimals={2}
|
|
567
|
+
label="MONTHLY REVENUE"
|
|
568
|
+
delta="+24.6%"
|
|
569
|
+
duration={1.2}
|
|
570
|
+
/>
|
|
571
|
+
);
|
|
572
|
+
}
|
|
573
|
+
```
|
|
574
|
+
|
|
575
|
+
---
|
|
576
|
+
|
|
577
|
+
## RadialProgress
|
|
578
|
+
|
|
579
|
+
```tsx
|
|
580
|
+
import { RadialProgress } from "@farzadbagheri/fb-components/data";
|
|
581
|
+
import "@farzadbagheri/fb-components/data.css";
|
|
582
|
+
|
|
583
|
+
export function ProgressExample() {
|
|
584
|
+
return (
|
|
585
|
+
<RadialProgress
|
|
586
|
+
value={84}
|
|
587
|
+
size={180}
|
|
588
|
+
strokeWidth={10}
|
|
589
|
+
color="#9b7cff"
|
|
590
|
+
trackColor="#24242c"
|
|
591
|
+
label="COMPLETE"
|
|
592
|
+
ariaLabel="Profile completion"
|
|
593
|
+
/>
|
|
594
|
+
);
|
|
595
|
+
}
|
|
596
|
+
```
|
|
597
|
+
|
|
598
|
+
Static version:
|
|
599
|
+
|
|
600
|
+
```tsx
|
|
601
|
+
<RadialProgress
|
|
602
|
+
value={84}
|
|
603
|
+
animated={false}
|
|
604
|
+
ariaLabel="Profile completion"
|
|
605
|
+
/>
|
|
606
|
+
```
|
|
607
|
+
|
|
608
|
+
---
|
|
609
|
+
|
|
610
|
+
# Mixed Product Section
|
|
611
|
+
|
|
612
|
+
Use multiple categories together while still importing focused CSS.
|
|
613
|
+
|
|
614
|
+
```tsx
|
|
615
|
+
import {
|
|
616
|
+
GlowButton,
|
|
617
|
+
GlassButton,
|
|
618
|
+
} from "@farzadbagheri/fb-components/buttons";
|
|
619
|
+
|
|
620
|
+
import {
|
|
621
|
+
GlassCard,
|
|
622
|
+
SpotlightCard,
|
|
623
|
+
} from "@farzadbagheri/fb-components/ui";
|
|
624
|
+
|
|
625
|
+
import {
|
|
626
|
+
AnimatedCounter,
|
|
627
|
+
RadialProgress,
|
|
628
|
+
} from "@farzadbagheri/fb-components/data";
|
|
629
|
+
|
|
630
|
+
import "@farzadbagheri/fb-components/buttons.css";
|
|
631
|
+
import "@farzadbagheri/fb-components/ui.css";
|
|
632
|
+
import "@farzadbagheri/fb-components/data.css";
|
|
633
|
+
|
|
634
|
+
export function ProductOverview() {
|
|
635
|
+
return (
|
|
636
|
+
<SpotlightCard>
|
|
637
|
+
<GlassCard>
|
|
638
|
+
<h2>
|
|
639
|
+
Product analytics
|
|
640
|
+
</h2>
|
|
641
|
+
|
|
642
|
+
<AnimatedCounter
|
|
643
|
+
value={128}
|
|
644
|
+
suffix="K"
|
|
645
|
+
label="ACTIVE USERS"
|
|
646
|
+
delta="+18.4%"
|
|
647
|
+
/>
|
|
648
|
+
|
|
649
|
+
<RadialProgress
|
|
650
|
+
value={72}
|
|
651
|
+
ariaLabel="Adoption progress"
|
|
652
|
+
/>
|
|
653
|
+
|
|
654
|
+
<div
|
|
655
|
+
style={{
|
|
656
|
+
display: "flex",
|
|
657
|
+
gap: 12,
|
|
658
|
+
}}
|
|
659
|
+
>
|
|
660
|
+
<GlowButton>
|
|
661
|
+
Open dashboard
|
|
662
|
+
</GlowButton>
|
|
663
|
+
|
|
664
|
+
<GlassButton>
|
|
665
|
+
Learn more
|
|
666
|
+
</GlassButton>
|
|
667
|
+
</div>
|
|
668
|
+
</GlassCard>
|
|
669
|
+
</SpotlightCard>
|
|
670
|
+
);
|
|
671
|
+
}
|
|
672
|
+
```
|
|
673
|
+
|
|
674
|
+
---
|
|
675
|
+
|
|
676
|
+
# Category CSS Strategy
|
|
677
|
+
|
|
678
|
+
Recommended for focused imports:
|
|
679
|
+
|
|
680
|
+
```tsx
|
|
681
|
+
import { GlassButton } from "@farzadbagheri/fb-components/buttons";
|
|
682
|
+
import "@farzadbagheri/fb-components/buttons.css";
|
|
683
|
+
```
|
|
684
|
+
|
|
685
|
+
For multiple categories:
|
|
686
|
+
|
|
687
|
+
```tsx
|
|
688
|
+
import { GlassButton } from "@farzadbagheri/fb-components/buttons";
|
|
689
|
+
import { GlassCard } from "@farzadbagheri/fb-components/ui";
|
|
690
|
+
import { RadialProgress } from "@farzadbagheri/fb-components/data";
|
|
691
|
+
|
|
692
|
+
import "@farzadbagheri/fb-components/buttons.css";
|
|
693
|
+
import "@farzadbagheri/fb-components/ui.css";
|
|
694
|
+
import "@farzadbagheri/fb-components/data.css";
|
|
695
|
+
```
|
|
696
|
+
|
|
697
|
+
This is the preferred pattern when you want tighter CSS control.
|
|
698
|
+
|
|
699
|
+
---
|
|
700
|
+
|
|
701
|
+
# Full Stylesheet Strategy
|
|
702
|
+
|
|
703
|
+
For applications using many categories:
|
|
704
|
+
|
|
705
|
+
```tsx
|
|
706
|
+
import {
|
|
707
|
+
GlassButton,
|
|
708
|
+
GlassCard,
|
|
709
|
+
RadialProgress,
|
|
710
|
+
SaasLaunchHero,
|
|
711
|
+
} from "@farzadbagheri/fb-components";
|
|
712
|
+
|
|
713
|
+
import "@farzadbagheri/fb-components/styles.css";
|
|
714
|
+
|
|
715
|
+
export function App() {
|
|
716
|
+
return (
|
|
717
|
+
<>
|
|
718
|
+
<SaasLaunchHero />
|
|
719
|
+
|
|
720
|
+
<GlassCard>
|
|
721
|
+
<RadialProgress
|
|
722
|
+
value={72}
|
|
723
|
+
ariaLabel="Progress"
|
|
724
|
+
/>
|
|
725
|
+
|
|
726
|
+
<GlassButton>
|
|
727
|
+
Continue
|
|
728
|
+
</GlassButton>
|
|
729
|
+
</GlassCard>
|
|
730
|
+
</>
|
|
731
|
+
);
|
|
732
|
+
}
|
|
733
|
+
```
|
|
734
|
+
|
|
735
|
+
The root stylesheet includes all public component styles.
|
|
736
|
+
|
|
737
|
+
---
|
|
738
|
+
|
|
739
|
+
# TypeScript Example
|
|
740
|
+
|
|
741
|
+
Type declarations ship with the package.
|
|
742
|
+
|
|
743
|
+
```tsx
|
|
744
|
+
import type {
|
|
745
|
+
ComponentProps,
|
|
746
|
+
} from "react";
|
|
747
|
+
|
|
748
|
+
import {
|
|
749
|
+
RadialProgress,
|
|
750
|
+
} from "@farzadbagheri/fb-components/data";
|
|
751
|
+
|
|
752
|
+
import "@farzadbagheri/fb-components/data.css";
|
|
753
|
+
|
|
754
|
+
type ProgressProps =
|
|
755
|
+
ComponentProps<
|
|
756
|
+
typeof RadialProgress
|
|
757
|
+
>;
|
|
758
|
+
|
|
759
|
+
const progressProps:
|
|
760
|
+
ProgressProps = {
|
|
761
|
+
value: 72,
|
|
762
|
+
label: "COMPLETE",
|
|
763
|
+
ariaLabel:
|
|
764
|
+
"Profile completion",
|
|
765
|
+
};
|
|
766
|
+
|
|
767
|
+
export function TypedExample() {
|
|
768
|
+
return (
|
|
769
|
+
<RadialProgress
|
|
770
|
+
{...progressProps}
|
|
771
|
+
/>
|
|
772
|
+
);
|
|
773
|
+
}
|
|
774
|
+
```
|
|
775
|
+
|
|
776
|
+
No separate `@types` package is required.
|
|
777
|
+
|
|
778
|
+
---
|
|
779
|
+
|
|
780
|
+
# Vite Example
|
|
781
|
+
|
|
782
|
+
Install:
|
|
783
|
+
|
|
784
|
+
```bash
|
|
785
|
+
npm install @farzadbagheri/fb-components
|
|
786
|
+
```
|
|
787
|
+
|
|
788
|
+
Example `src/App.tsx`:
|
|
789
|
+
|
|
790
|
+
```tsx
|
|
791
|
+
import {
|
|
792
|
+
GlowButton,
|
|
793
|
+
GlassCard,
|
|
794
|
+
} from "@farzadbagheri/fb-components";
|
|
795
|
+
|
|
796
|
+
import "@farzadbagheri/fb-components/styles.css";
|
|
797
|
+
|
|
798
|
+
export default function App() {
|
|
799
|
+
return (
|
|
800
|
+
<main
|
|
801
|
+
style={{
|
|
802
|
+
maxWidth: 760,
|
|
803
|
+
margin: "40px auto",
|
|
804
|
+
}}
|
|
805
|
+
>
|
|
806
|
+
<GlassCard>
|
|
807
|
+
<h1>
|
|
808
|
+
FB Components
|
|
809
|
+
</h1>
|
|
810
|
+
|
|
811
|
+
<GlowButton>
|
|
812
|
+
Launch
|
|
813
|
+
</GlowButton>
|
|
814
|
+
</GlassCard>
|
|
815
|
+
</main>
|
|
816
|
+
);
|
|
817
|
+
}
|
|
818
|
+
```
|
|
819
|
+
|
|
820
|
+
No additional setup is required beyond standard React/Vite configuration.
|
|
821
|
+
|
|
822
|
+
---
|
|
823
|
+
|
|
824
|
+
# Next.js Client Component Example
|
|
825
|
+
|
|
826
|
+
Interactive components should be used in a client component when required by the Next.js rendering model.
|
|
827
|
+
|
|
828
|
+
```tsx
|
|
829
|
+
"use client";
|
|
830
|
+
|
|
831
|
+
import {
|
|
832
|
+
AiPromptBox,
|
|
833
|
+
} from "@farzadbagheri/fb-components/ai";
|
|
834
|
+
|
|
835
|
+
import "@farzadbagheri/fb-components/ai.css";
|
|
836
|
+
|
|
837
|
+
export default function AiClientPanel() {
|
|
838
|
+
return (
|
|
839
|
+
<AiPromptBox
|
|
840
|
+
placeholder="Ask anything..."
|
|
841
|
+
onSubmit={(value) => {
|
|
842
|
+
console.log(value);
|
|
843
|
+
}}
|
|
844
|
+
/>
|
|
845
|
+
);
|
|
846
|
+
}
|
|
847
|
+
```
|
|
848
|
+
|
|
849
|
+
For App Router projects, place the component inside a file that begins with:
|
|
850
|
+
|
|
851
|
+
```tsx
|
|
852
|
+
"use client";
|
|
853
|
+
```
|
|
854
|
+
|
|
855
|
+
when the component or surrounding logic requires client-side interactivity.
|
|
856
|
+
|
|
857
|
+
---
|
|
858
|
+
|
|
859
|
+
# Accessibility Examples
|
|
860
|
+
|
|
861
|
+
## Accessible progress
|
|
862
|
+
|
|
863
|
+
```tsx
|
|
864
|
+
<RadialProgress
|
|
865
|
+
value={72}
|
|
866
|
+
label="COMPLETE"
|
|
867
|
+
ariaLabel="Profile completion"
|
|
868
|
+
/>
|
|
869
|
+
```
|
|
870
|
+
|
|
871
|
+
The component exposes progressbar semantics including:
|
|
872
|
+
|
|
873
|
+
```text
|
|
874
|
+
role="progressbar"
|
|
875
|
+
aria-valuemin
|
|
876
|
+
aria-valuemax
|
|
877
|
+
aria-valuenow
|
|
878
|
+
aria-valuetext
|
|
879
|
+
```
|
|
880
|
+
|
|
881
|
+
---
|
|
882
|
+
|
|
883
|
+
## Accessible button labels
|
|
884
|
+
|
|
885
|
+
Prefer clear action text:
|
|
886
|
+
|
|
887
|
+
```tsx
|
|
888
|
+
<GlowButton>
|
|
889
|
+
Create project
|
|
890
|
+
</GlowButton>
|
|
891
|
+
```
|
|
892
|
+
|
|
893
|
+
instead of vague labels when context is not obvious.
|
|
894
|
+
|
|
895
|
+
---
|
|
896
|
+
|
|
897
|
+
## AI prompt accessibility
|
|
898
|
+
|
|
899
|
+
`AiPromptBox` uses its placeholder as the textarea accessible label.
|
|
900
|
+
|
|
901
|
+
```tsx
|
|
902
|
+
<AiPromptBox
|
|
903
|
+
placeholder="Describe the report you want to generate"
|
|
904
|
+
/>
|
|
905
|
+
```
|
|
906
|
+
|
|
907
|
+
Use a meaningful placeholder when accessibility and clarity matter.
|
|
908
|
+
|
|
909
|
+
---
|
|
910
|
+
|
|
911
|
+
## Decorative motion
|
|
912
|
+
|
|
913
|
+
Cursor visuals and several decorative elements are hidden from assistive technology.
|
|
914
|
+
|
|
915
|
+
Keep meaningful interaction on native semantic elements:
|
|
916
|
+
|
|
917
|
+
```tsx
|
|
918
|
+
<MagneticCursor>
|
|
919
|
+
<button
|
|
920
|
+
type="button"
|
|
921
|
+
data-magnetic-target
|
|
922
|
+
>
|
|
923
|
+
Open project
|
|
924
|
+
</button>
|
|
925
|
+
</MagneticCursor>
|
|
926
|
+
```
|
|
927
|
+
|
|
928
|
+
---
|
|
929
|
+
|
|
930
|
+
# Recommended Composition Patterns
|
|
931
|
+
|
|
932
|
+
## Product Hero
|
|
933
|
+
|
|
934
|
+
```tsx
|
|
935
|
+
<SaasLaunchHero />
|
|
936
|
+
```
|
|
937
|
+
|
|
938
|
+
Use when you want a complete polished hero section quickly.
|
|
939
|
+
|
|
940
|
+
---
|
|
941
|
+
|
|
942
|
+
## Startup Page
|
|
943
|
+
|
|
944
|
+
```tsx
|
|
945
|
+
<StartupLanding />
|
|
946
|
+
```
|
|
947
|
+
|
|
948
|
+
Use when you want a more complete landing-page composition with navigation, metrics, and features.
|
|
949
|
+
|
|
950
|
+
---
|
|
951
|
+
|
|
952
|
+
## AI Workspace
|
|
953
|
+
|
|
954
|
+
```tsx
|
|
955
|
+
<div>
|
|
956
|
+
<AiPromptBox />
|
|
957
|
+
<StreamingResponse />
|
|
958
|
+
</div>
|
|
959
|
+
```
|
|
960
|
+
|
|
961
|
+
Use for prompt-and-response interfaces.
|
|
962
|
+
|
|
963
|
+
---
|
|
964
|
+
|
|
965
|
+
## Analytics Surface
|
|
966
|
+
|
|
967
|
+
```tsx
|
|
968
|
+
<div>
|
|
969
|
+
<AnimatedCounter />
|
|
970
|
+
<RadialProgress />
|
|
971
|
+
<MetricGrid />
|
|
972
|
+
</div>
|
|
973
|
+
```
|
|
974
|
+
|
|
975
|
+
Use for dashboard or product analytics views.
|
|
976
|
+
|
|
977
|
+
---
|
|
978
|
+
|
|
979
|
+
## Premium Product Card
|
|
980
|
+
|
|
981
|
+
```tsx
|
|
982
|
+
<SpotlightCard>
|
|
983
|
+
<GlassCard>
|
|
984
|
+
<h3>
|
|
985
|
+
Pro Workspace
|
|
986
|
+
</h3>
|
|
987
|
+
|
|
988
|
+
<p>
|
|
989
|
+
A polished product card composition.
|
|
990
|
+
</p>
|
|
991
|
+
|
|
992
|
+
<GlowButton>
|
|
993
|
+
Upgrade
|
|
994
|
+
</GlowButton>
|
|
995
|
+
</GlassCard>
|
|
996
|
+
</SpotlightCard>
|
|
997
|
+
```
|
|
998
|
+
|
|
999
|
+
---
|
|
1000
|
+
|
|
1001
|
+
# Root Import Reference
|
|
1002
|
+
|
|
1003
|
+
All public components:
|
|
1004
|
+
|
|
1005
|
+
```tsx
|
|
1006
|
+
import {
|
|
1007
|
+
AiPromptBox,
|
|
1008
|
+
AnimatedCounter,
|
|
1009
|
+
AuroraGrid,
|
|
1010
|
+
BlurReveal,
|
|
1011
|
+
DotMatrix,
|
|
1012
|
+
GlassButton,
|
|
1013
|
+
GlassCard,
|
|
1014
|
+
GlowButton,
|
|
1015
|
+
GlowCursor,
|
|
1016
|
+
GradientMesh,
|
|
1017
|
+
MagneticButton,
|
|
1018
|
+
MagneticCursor,
|
|
1019
|
+
MetricGrid,
|
|
1020
|
+
NoiseField,
|
|
1021
|
+
PredictiveArc,
|
|
1022
|
+
RadialProgress,
|
|
1023
|
+
RevealText,
|
|
1024
|
+
SaasLaunchHero,
|
|
1025
|
+
SignalParticles,
|
|
1026
|
+
SpotlightCard,
|
|
1027
|
+
StartupLanding,
|
|
1028
|
+
StreamingResponse,
|
|
1029
|
+
} from "@farzadbagheri/fb-components";
|
|
1030
|
+
```
|
|
1031
|
+
|
|
1032
|
+
Root CSS:
|
|
1033
|
+
|
|
1034
|
+
```tsx
|
|
1035
|
+
import "@farzadbagheri/fb-components/styles.css";
|
|
1036
|
+
```
|
|
1037
|
+
|
|
1038
|
+
---
|
|
1039
|
+
|
|
1040
|
+
# Useful Links
|
|
1041
|
+
|
|
1042
|
+
- Main documentation: `README.md`
|
|
1043
|
+
- API reference: `COMPONENTS.md`
|
|
1044
|
+
- Contributing: `CONTRIBUTING.md`
|
|
1045
|
+
- Security: `SECURITY.md`
|
|
1046
|
+
- Release guide: `RELEASING.md`
|
|
1047
|
+
|
|
1048
|
+
Live catalog:
|
|
1049
|
+
|
|
1050
|
+
https://farzadbagheri.fr/en/components
|
|
1051
|
+
|
|
1052
|
+
French catalog:
|
|
1053
|
+
|
|
1054
|
+
https://farzadbagheri.fr/fr/composants
|
|
1055
|
+
|
|
1056
|
+
MCP documentation:
|
|
1057
|
+
|
|
1058
|
+
https://farzadbagheri.fr/en/components/mcp
|
|
1059
|
+
|
|
1060
|
+
---
|
|
1061
|
+
|
|
1062
|
+
# License
|
|
1063
|
+
|
|
1064
|
+
MIT © 2026 Farzad Bagheri.
|