Swirski UI

Backgrounds

DiagonalLines

A configurable diagonal stripe background for punchy poster and pop-art compositions.

Component

38

Request Changes

Import

import { DiagonalLines } from "@swirski/ui";

Playground

7 controls

Controls

-35
0.3
18
2
6

Usage

<div className="relative h-72 overflow-hidden border-4 border-black bg-[#FFD400]">
  <DiagonalLines
    className="inset-0"
    angle={-35}
    color="#0B0B0C"
    opacity={0.3}
    spacing={18}
    thickness={2}
    accentColor="#FF3131"
    accentEvery={6}
    accentThickness={8}
  />
</div>

Props

11 generated
PropTypeDefaultNotes
accentColorstring-Optional color for heavier accent stripes.
accentEverynumber-Adds accent stripes every N repeats when greater than 1.
accentThicknessstring | number5Thickness for accent stripes.
anglestring | number-45Line angle in degrees or any CSS angle value.
colorstring"#0B0B0C"Primary stripe color.
opacityCSSProperties['Opacity']0.2Opacity applied to the stripe layer.
size'sm' | 'md' | 'lg'"md"Generated from DiagonalLinesProps.
spacingstring | number18Distance before the pattern repeats.
thicknessstring | number2Primary stripe thickness.
tone'default'"default"Generated from DiagonalLinesProps.
variant'default' | 'accent'"default"Generated from DiagonalLinesProps.
...divPropsOmit<HTMLAttributes<HTMLDivElement>, "color">-Forwarded to the root div.
Previous: LineGridNext: Badge