Vertical Lines Background
shadcn-ui-blocks-shadcnship/background-04FreeBlock
Customizable vertical lines background with adjustable line count, width, color, and opacity. Use it behind hero or pricing sections to create a structured, architectural visual backdrop.
See it running
Open the demo on shadcn-ui-blocks
shadcnship.com/blocks/background-04Install it
npx shadcn@latest add https://shadcnship.com/r/background-04.jsonSource
1import { cn } from "@/lib/utils";23type MaskPosition = "top" | "bottom" | "center" | "none";45type Background04Props = {6 className?: string;7 lineCount?: number;8 lineWidth?: number;9 lineColor?: string;10 gap?: number;11 mask?: MaskPosition;12};1314const getMaskStyle = (mask: MaskPosition): string => {15 switch (mask) {16 case "top":17 return "radial-gradient(ellipse 60% 50% at 50% 0%, transparent 40%, #000 110%)";18 case "bottom":19 return "radial-gradient(ellipse 60% 50% at 50% 100%, transparent 40%, #000 110%)";20 case "center":21 return "radial-gradient(ellipse 50% 50% at 50% 50%, transparent 20%, #000 70%)";22 case "none":23 default:24 return "none";25 }26};2728const Background04 = ({29 className,30 lineCount = 12,31 lineWidth = 1,32 lineColor = "var(--border)",33 gap = 0,34 mask = "none",35}: Background04Props) => {36 const maskStyle = getMaskStyle(mask);3738 return (39 <div40 className={cn(41 "pointer-events-none absolute inset-0 z-0 overflow-hidden",42 className43 )}44 style={45 mask !== "none"46 ? {47 maskImage: maskStyle,48 WebkitMaskImage: maskStyle,49 }50 : undefined51 }52 >53 <div54 className="flex size-full items-stretch justify-between"55 style={{ padding: gap ? `0 ${gap}px` : undefined }}56 >57 {Array.from({ length: lineCount }).map((_, i) => (58 <div59 key={i}60 style={{61 width: `${lineWidth}px`,62 backgroundColor: lineColor,63 }}64 />65 ))}66 </div>67 </div>68 );69};7071export default Background04;
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 | |
| 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 | |
| Comparison 01comparison-01 | shadcn-ui-blocks | Blocks | Free | 1 dep |
