BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/shadcn-ui-blocks/background-01

Square Grid Background

shadcn-ui-blocks-shadcnship/background-01
FreeBlock

Customizable square grid background component with adjustable line color, grid size, and opacity props. Use it as a decorative backdrop for hero sections, cards, or any area that benefits from a subtle geometric texture.

See it running

Open the demo on shadcn-ui-blocks

shadcnship.com/blocks/background-01
Open
This registry sends X-Frame-Options, so its page cannot be embedded here. The link is the same page the frame would have shown.

Install it

npx shadcn@latest add https://shadcnship.com/r/background-01.json

Source

src/registry/blocks/background-01/background.tsxshadcnship.com/r/background-01.json
1import { cn } from "@/lib/utils";
2
3type MaskPosition = "top" | "bottom" | "center" | "none";
4
5type Background01Props = {
6 className?: string;
7 lineColor?: string;
8 gridSizeX?: number;
9 gridSizeY?: number;
10 mask?: MaskPosition;
11};
12
13const getMaskStyle = (mask: MaskPosition): string => {
14 switch (mask) {
15 case "top":
16 return "radial-gradient(ellipse 60% 50% at 50% 0%, transparent 40%, #000 110%)";
17 case "bottom":
18 return "radial-gradient(ellipse 60% 50% at 50% 100%, transparent 40%, #000 110%)";
19 case "center":
20 return "radial-gradient(ellipse 50% 50% at 50% 50%, transparent 20%, #000 70%)";
21 case "none":
22 default:
23 return "none";
24 }
25};
26
27const Background01 = ({
28 className,
29 lineColor = "var(--border)",
30 gridSizeX = 20,
31 gridSizeY = 20,
32 mask = "none",
33}: Background01Props) => {
34 const maskStyle = getMaskStyle(mask);
35
36 return (
37 <div className={cn("absolute inset-0 z-0 h-full w-full", className)}>
38 <div
39 className="absolute inset-0 h-full w-full pointer-events-none"
40 style={{
41 backgroundImage: `linear-gradient(to right, ${lineColor} 1px, transparent 1px), linear-gradient(to bottom, ${lineColor} 1px, transparent 1px)`,
42 backgroundSize: `${gridSizeX}px ${gridSizeY}px`,
43 ...(mask !== "none" && {
44 maskImage: maskStyle,
45 WebkitMaskImage: maskStyle,
46 }),
47 }}
48 />
49 </div>
50 );
51};
52
53export default Background01;

Files it writes

  • src/registry/blocks/background-01/background.tsx

Facts

Registry
shadcn-ui-blocks
Type
registry:block
Access
Free
Files written
1
Licence
the repository states none
First indexed
2026-08-01
Last confirmed
today

Go to the source

Docs on shadcn-ui-blocks shadcnship.com arnaudvolp/shadcnship on GitHub Raw registry item This item as JSON

More from shadcn-ui-blocks

All 74 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
Dot Pattern Backgroundbackground-02shadcn-ui-blocksBlocksFreeno deps
Diagonal Stripes Backgroundbackground-03shadcn-ui-blocksBlocksFreeno deps
Vertical Lines Backgroundbackground-04shadcn-ui-blocksBlocksFreeno deps
Interactive Grid Backgroundbackground-05shadcn-ui-blocksBlocksFreeno deps
Banner 01banner-01shadcn-ui-blocksBlocksFree1 dep
Blog 01blog-01shadcn-ui-blocksBlocksFreeno deps
Changelog 01changelog-01shadcn-ui-blocksBlocksFreeno deps
Comparison 01comparison-01shadcn-ui-blocksBlocksFree1 dep
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