BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/SmoothUI Registry/header-1

Header 1

smoothui-registry/header-1
FreeBlock

Modern header block with navigation and mobile menu

Install it

npx shadcn@latest add https://www.smoothui.dev/r/header-1.json

Source

index.tsxwww.smoothui.dev/r/header-1.json
1"use client";
2
3import { ExternalLink } from "lucide-react";
4import { useEffect, useRef, useState } from "react";
5import { AnimatedGroup, AnimatedText, Button, HeroHeader } from "@/components/smoothui/shared";
6import styles from "./hero-grid.module.css";
7
8const CELL_SIZE = 120; // px
9const COLORS = [
10 "oklch(0.72 0.2 352.53)", // blue
11 "#A764FF",
12 "#4B94FD",
13 "#FD4B4E",
14 "#FF8743",
15];
16
17function getRandomColor() {
18 return COLORS[Math.floor(Math.random() * COLORS.length)];
19}
20
21function SubGrid() {
22 const [cellColors, setCellColors] = useState<(string | null)[]>([
23 null,
24 null,
25 null,
26 null,
27 ]);
28 // Add refs for leave timeouts
29 const leaveTimeouts = useRef<(NodeJS.Timeout | null)[]>([
30 null,
31 null,
32 null,
33 null,
34 ]);
35
36 function handleHover(cellIdx: number) {
37 // Clear any pending timeout for this cell
38 const timeout = leaveTimeouts.current[cellIdx];
39 if (timeout) {
40 clearTimeout(timeout);
41 leaveTimeouts.current[cellIdx] = null;
42 }
43 setCellColors((prev) =>
44 prev.map((c, i) => (i === cellIdx ? getRandomColor() : c))
45 );
46 }
47 function handleLeave(cellIdx: number) {
48 // Add a small delay before removing the color
49 leaveTimeouts.current[cellIdx] = setTimeout(() => {
50 setCellColors((prev) => prev.map((c, i) => (i === cellIdx ? null : c)));
51 leaveTimeouts.current[cellIdx] = null;
52 }, 120);
53 }
54 // Cleanup on unmount
55 useEffect(
56 () => () => {
57 for (const t of leaveTimeouts.current) {
58 if (t) {
59 clearTimeout(t);
60 }
61 }
62 },
63 []
64 );
65
66 return (
67 <div className={styles.subgrid} style={{ pointerEvents: "none" }}>
68 {[0, 1, 2, 3].map((cellIdx) => (
69 <button
70 className={styles.cell}
71 key={cellIdx}
72 onMouseEnter={() => handleHover(cellIdx)}
73 onMouseLeave={() => handleLeave(cellIdx)}
74 style={{
75 background: cellColors[cellIdx] || "transparent",
76 pointerEvents: "auto",
77 }}
78 type="button"
79 />
80 ))}
81 </div>
82 );
83}
84
85function InteractiveGrid() {
86 const containerRef = useRef<HTMLDivElement>(null);
87 const [grid, setGrid] = useState({ columns: 0, rows: 0 });
88
89 useEffect(() => {
90 function updateGrid() {
91 if (containerRef.current) {
92 const { width, height } = containerRef.current.getBoundingClientRect();
93 setGrid({
94 columns: Math.ceil(width / CELL_SIZE),
95 rows: Math.ceil(height / CELL_SIZE),
96// … truncated

What it pulls in

npm packages

  • lucide-react
  • motion

Other registry items

  • https://smoothui.dev/r/shared.json
  • https://smoothui.dev/r/tokens.json

Files it writes

  • index.tsx
  • hero-grid.module.css

Facts

Registry
SmoothUI Registry
Type
registry:block
Access
Free
Files written
2
Licence
the repository states none
First indexed
2026-08-02
Last confirmed
yesterday

Go to the source

www.smoothui.dev educlopez/smoothui on GitHub Raw registry item This item as JSON

More from SmoothUI Registry

All 177 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
Chat Templatechat-templateSmoothUI RegistryBlocksFree2 deps · 4 files
Cta 1cta-1SmoothUI RegistryBlocksFree1 dep
Cta 2cta-2SmoothUI RegistryBlocksFree1 dep
Cta 3cta-3SmoothUI RegistryBlocksFree1 dep
Faq 1faq-1SmoothUI RegistryBlocksFree2 deps
Faq 2faq-2SmoothUI RegistryBlocksFree1 dep
Faq 3faq-3SmoothUI RegistryBlocksFree2 deps
Faq 4faq-4SmoothUI RegistryBlocksFree2 deps
BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex

BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex

BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex