UIPin
ComponentsIconsIllustrationsMotionTemplatesApps
Boards
UIPin

Free, open-source UI components, icons, illustrations, motion, templates and apps, in one search. Every item links to its source and licence.

UIPin is free. If it saved you time, you can keep it running:

Buy me a coffee
ComponentsIconsIllustrationsMotionTemplatesAppsLibrariesCompareNew this weekMCP for agentsBoardsPrivacy

Components, icons and artwork belong to their authors and are shown under their open-source licences.

Magic UI/Striped Pattern

Backgrounds
1 of 7
Compiling

Theme it

Every preview, live

Brand colour

Corner radius

Font

Recolours shadcn’s tokens, Tailwind’s accent colours and colours set in the code. Red, amber and green classes stay, since they usually mean error, warning or success.

7 versions·2 libraries

  • Striped Pattern
  • Eldora UI
  • Animated Grid Pattern
  • Dot Pattern
  • Grid Pattern
  • Hexagon Pattern
  • Interactive Grid Pattern

Striped Pattern

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

npx shadcn@latest add https://magicui.design/r/striped-pattern.json
Open in v0 Docs Repo
Library
Magic UI
License
MIT
Stack
React · Tailwind CSS
Size
51 lines
Demo
From Magic UI

Code

components/magicui/striped-pattern.tsx

import React, { useId } from "react"

import { cn } from "@/lib/utils"

interface StripedPatternProps extends React.SVGProps<SVGSVGElement> {
  direction?: "left" | "right"
}

export function StripedPattern({
  direction = "left",
  className,
  width = 10,
  height = 10,
  ...props
}: StripedPatternProps) {
  const id = useId()
  const w = Number(width)
  const h = Number(height)

  return (
    <svg
      aria-hidden="true"
      className={cn(
        "pointer-events-none absolute inset-0 z-10 h-full w-full stroke-[0.5]",
        className
      )}
      xmlns="http://www.w3.org/2000/svg"
      {...props}
    >
      <defs>
        <pattern id={id} width={w} height={h} patternUnits="userSpaceOnUse">
          {direction === "left" ? (
            <>
              <line x1="0" y1={h} x2={w} y2="0" stroke="currentColor" />
              <line x1={-w} y1={h} x2="0" y2="0" stroke="currentColor" />
              <line x1={w} y1={h} x2={w * 2} y2="0" stroke="currentColor" />
            </>
          ) : (
            <>
              <line x1="0" y1="0" x2={w} y2={h} stroke="currentColor" />
              <line x1={-w} y1="0" x2="0" y2={h} stroke="currentColor" />
              <line x1={w} y1="0" x2={w * 2} y2={h} stroke="currentColor" />
            </>
          )}
        </pattern>
      </defs>
      <rect width="100%" height="100%" fill={`url(#${id})`} />
    </svg>
  )
}

More like this

Grid Pattern

Magic UI·Backgrounds

Interactive Grid Pattern

Magic UI·Backgrounds

Animated Grid Pattern

Magic UI·Backgrounds

Dot Pattern

Magic UI·Backgrounds

Drape Background

Kokonut UI·Backgrounds

Skeleton

shadcn/ui·Feedback & loaders

Noise Texture

Magic UI·Backgrounds

Android

Magic UI·Media & 3D

Accordion

SmoothUI·Data display

Glyph Matrix

Magic UI·Cursor & effects

8-bit Slider

8bitcn·Inputs & forms

Holo Card

React Bits·CardsMIT+

8-bit Health Bar

8bitcn·Feedback & loaders

8-bit Mana Bar

8bitcn·Feedback & loaders

8-bit Progress

8bitcn·Feedback & loaders