Line Grid

Installation

npm i @paper-design/shaders-react

Code

import { LineGrid } from '@paper-design/shaders-react';

<LineGrid
  style={{ height: 500 }}
  colorBack="#000000"
  colorFill="#ffffff"
  colorStroke="#ffaa00"
  size={1}
  gapX={32}
  gapY={32}
  strokeWidth={0}
  sizeRange={0.5}
  opacityRange={0}
  shape="horizontal"
  rotation={0}
/>

Props

NameDescriptionTypeValues
colorBackBackground colorstringHex, RGB, or HSL color
colorFillShape fill colorstringHex, RGB, or HSL color
colorStrokeShape stroke colorstringHex, RGB, or HSL color
shapeThe shape typeenum
| "horizontal" | "vertical" | "diagonalForward" | "diagonalBack" | "cross"
sizeBase size of each line, pixelsnumber1 to 100
gapXPattern horizontal spacing, pixelsnumber2 to 500
gapYPattern vertical spacing, pixelsnumber2 to 500
strokeWidthThe outline stroke width, pixelsnumber0 to 50
sizeRangeRandom variation in shape size (0 = uniform size, higher = random value up to base size)number0 to 1
opacityRangeRandom variation in shape opacity (0 = all shapes opaque, higher = semi-transparent dots)number0 to 1
rotationOverall rotation angle of the graphicsnumber0 to 360

Description

Static grid pattern made of lines, horizontal, vertical, diagonal, cross.