Striped Pattern
A background striped pattern made with SVGs, fully customizable using Tailwind CSS.
import { StripedPattern } from '@/registry/magicui/striped-pattern'
export function StripedPatternDemo() { return ( <div class=" relative flex h-125 w-full flex-col items-center justify-center overflow-hidden rounded-lg border " > <StripedPattern class=" mask-[radial-gradient(300px_circle_at_center,white,transparent)] " /> </div> )}Installation
Section titled “Installation”pnpm dlx shadcn@latest add @magicui-solid/striped-patternbunx shadcn@latest add @magicui-solid/striped-patternyarn dlx shadcn@latest add @magicui-solid/striped-patternnpx shadcn@latest add @magicui-solid/striped-patternExamples
Section titled “Examples”Striped Pattern with a dashed stroke
Section titled “Striped Pattern with a dashed stroke”import { StripedPattern } from '@/registry/magicui/striped-pattern'
export function StripedPatternDashed() { return ( <div class=" relative flex h-75 w-full flex-col items-center justify-center overflow-hidden rounded-lg border " > <StripedPattern class="stroke-[0.3] [stroke-dasharray:8,4]" /> </div> )}Striped Pattern To Right
Section titled “Striped Pattern To Right”import { StripedPattern } from '@/registry/magicui/striped-pattern'
export function StripedPatternRight() { return ( <div class=" relative flex h-75 w-full flex-col items-center justify-center overflow-hidden rounded-lg border " > <StripedPattern direction="right" /> </div> )}import { StripedPattern } from '@/components/magicui/striped-pattern'<div className="relative h-[500px] w-full overflow-hidden"> <StripedPattern /></div>StripedPattern
Section titled “StripedPattern”| Prop | Type | Default | Description |
|---|---|---|---|
width |
number |
10 |
Width of the pattern |
height |
number |
10 |
Height of the pattern |
direction |
"left" "right" |
"left" |
Line direction |
class |
string |
- |
Additional classes on the root SVG |
Credits
Section titled “Credits”- Credit to @chishiyac
Original:
magicui.design/docs/components/striped-pattern