Skip to content
Magic UI SolidMagicUI Solid

Striped Pattern

A background striped pattern made with SVGs, fully customizable using Tailwind CSS.

@/demos/StripedPatternDemo.tsx
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>
)
}
Terminal window
pnpm dlx shadcn@latest add @magicui-solid/striped-pattern
@/demos/StripedPatternDashed.tsx
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>
)
}
@/demos/StripedPatternRight.tsx
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>
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

Original:

magicui.design/docs/components/striped-pattern