CTA 04
shadcn-ui-blocks-shadcnship/cta-04FreeBlock
Centered CTA card with a subtle grid background, bold headline, description, and action button. Use it as a section-closing block that re-engages visitors who scrolled past earlier conversion points.
See it running
Open the demo on shadcn-ui-blocks
shadcnship.com/blocks/cta-04Install it
npx shadcn@latest add https://shadcnship.com/r/cta-04.jsonSource
1"use client";23import { useEffect, useRef, useState } from "react";4import { ArrowUpRight, Book } from "lucide-react";5import { cn } from "@/lib/utils";6import { Button } from "@/components/ui/button";7import { LogoIcon } from "../social-icons/icons";89const GRID = 80;1011const GridBackground = () => {12 const ref = useRef<HTMLDivElement>(null);13 const [grid, setGrid] = useState({ cols: 0, rows: 0, cellW: 0, cellH: 0 });1415 useEffect(() => {16 const update = () => {17 if (!ref.current) return;18 const { width, height } = ref.current.getBoundingClientRect();19 const cols = Math.max(1, Math.round(width / GRID));20 const rows = Math.max(1, Math.round(height / GRID));21 setGrid({ cols, rows, cellW: width / cols, cellH: height / rows });22 };23 update();24 window.addEventListener("resize", update);25 return () => window.removeEventListener("resize", update);26 }, []);2728 const { cols, rows, cellW, cellH } = grid;29 const total = cols * rows;3031 return (32 <div ref={ref} className="absolute inset-0 overflow-hidden">33 {total > 0 && (34 <div35 className="h-full w-full"36 style={{37 display: "grid",38 gridTemplateColumns: `repeat(${cols}, ${cellW}px)`,39 gridTemplateRows: `repeat(${rows}, ${cellH}px)`,40 }}41 >42 {Array.from({ length: total }).map((_, i) => (43 <div key={i} className="border-r border-b border-white/6" />44 ))}45 </div>46 )}47 </div>48 );49};5051interface Cta04Props {52 title?: string;53 description?: string;54 buttons?: {55 text: string;56 url?: string;57 icon?: React.ReactNode;58 variant?: "default" | "outline" | "ghost" | "secondary" | "link";59 }[];60 icon?: React.ReactNode;61 className?: string;62}6364const Cta04 = ({65 title = "Ship faster. Build better.",66 description = "Production-ready shadcn/ui blocks for your next project.",67 icon = <LogoIcon className="size-6 invert" />,68 buttons = [69 {70 text: "Get Started now",71 url: "#",72 icon: <ArrowUpRight className="size-4" />,73 variant: "secondary",74 },75 {76 text: "View Docs",77 url: "#",78 icon: <Book className="size-4" />,79 variant: "outline",80 },81 ],82 className,83}: Cta04Props) => (84 <section className={cn("w-full", className)}>85 <div className="relative flex items-center justify-center overflow-hidden bg-zinc-950 py-16 text-white md:py-24 lg:py-32">86 <GridBackground />87// … truncated
What it pulls in
npm packages
Other registry items
Files it writes
More from shadcn-ui-blocks
All 74 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Square Grid Backgroundbackground-01 | shadcn-ui-blocks | Blocks | Free | no deps | |
| Dot Pattern Backgroundbackground-02 | shadcn-ui-blocks | Blocks | Free | no deps | |
| Diagonal Stripes Backgroundbackground-03 | shadcn-ui-blocks | Blocks | Free | no deps | |
| Vertical Lines Backgroundbackground-04 | shadcn-ui-blocks | Blocks | Free | no deps | |
| Interactive Grid Backgroundbackground-05 | shadcn-ui-blocks | Blocks | Free | no deps | |
| Banner 01banner-01 | shadcn-ui-blocks | Blocks | Free | 1 dep | |
| Blog 01blog-01 | shadcn-ui-blocks | Blocks | Free | no deps | |
| Changelog 01changelog-01 | shadcn-ui-blocks | Blocks | Free | no deps |
