Header 4
smoothui-registry/header-4FreeBlock
Interactive 3D grid hero header inspired by rauno.me 2024
Install it
npx shadcn@latest add https://www.smoothui.dev/r/header-4.jsonSource
1/**2 * Header 4 - Interactive 3D Grid Hero3 *4 * Inspired by the beautiful interactive grid design from rauno.me 2024 website.5 * Features a 3D-perspective grid with customizable hover colors that respond6 * to user interaction, creating an engaging and modern hero section.7 *8 * @see https://rauno.me9 */1011"use client";1213import { ExternalLink } from "lucide-react";14import { useEffect, useRef } from "react";15import { AnimatedGroup, AnimatedText, Button, HeroHeader } from "@/components/smoothui/shared";16import styles from "./hero-grid.module.css";1718interface InteractiveGridProps {19 hoverColors?: string | [string, string, string, string];20}2122const TOTAL_TILES = 1600;23const INITIAL_TILE = 1;24const TILES_TO_CLONE = TOTAL_TILES - INITIAL_TILE;2526function InteractiveGrid({ hoverColors }: InteractiveGridProps) {27 const containerRef = useRef<HTMLDivElement>(null);28 const tileRef = useRef<HTMLDivElement>(null);2930 useEffect(() => {31 if (!(containerRef.current && tileRef.current)) {32 return;33 }3435 // Clone the first tile to create a 40x40 grid (1600 tiles total)36 for (let i = 0; i < TILES_TO_CLONE; i++) {37 const clonedTile = tileRef.current.cloneNode(true);38 containerRef.current.appendChild(clonedTile);39 }40 }, []);4142 // Prepare CSS variables for hover colors43 const style = hoverColors44 ? {45 "--hero-grid-hover-color-1": Array.isArray(hoverColors)46 ? hoverColors[0]47 : hoverColors,48 "--hero-grid-hover-color-2": Array.isArray(hoverColors)49 ? (hoverColors[1] ?? hoverColors[0])50 : hoverColors,51 "--hero-grid-hover-color-3": Array.isArray(hoverColors)52 ? (hoverColors[2] ?? hoverColors[0])53 : hoverColors,54 "--hero-grid-hover-color-4": Array.isArray(hoverColors)55 ? (hoverColors[3] ?? hoverColors[0])56 : hoverColors,57 }58 : undefined;5960 return (61 <div62 aria-hidden="true"63 className={styles.gridContainer}64 style={style as React.CSSProperties}65 >66 <div className={styles.mainGrid} ref={containerRef}>67 <div className={styles.tile} ref={tileRef} />68 </div>69 </div>70 );71}7273interface HeroGridProps {74 hoverColors?: string | [string, string, string, string];75}7677export function HeroGrid({ hoverColors }: HeroGridProps) {78 return (79 <div className="relative">80 <HeroHeader />81 <main>82 <section className="relative overflow-hidden py-36">83// … truncated
What it pulls in
npm packages
Other registry items
Files it writes
More from SmoothUI Registry
All 178 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Chat Templatechat-template | SmoothUI Registry | Blocks | Free | 2 deps · 4 files | |
| Cta 1cta-1 | SmoothUI Registry | Blocks | Free | 1 dep | |
| Cta 2cta-2 | SmoothUI Registry | Blocks | Free | 1 dep | |
| Cta 3cta-3 | SmoothUI Registry | Blocks | Free | 1 dep | |
| Faq 1faq-1 | SmoothUI Registry | Blocks | Free | 2 deps | |
| Faq 2faq-2 | SmoothUI Registry | Blocks | Free | 1 dep | |
| Faq 3faq-3 | SmoothUI Registry | Blocks | Free | 2 deps | |
| Faq 4faq-4 | SmoothUI Registry | Blocks | Free | 2 deps |
