Line Grid
Installation
npm i @paper-design/shaders-react
Code
import { LineGrid } from '@paper-design/shaders-react';
<LineGrid
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
| Name | Description | Type | Values |
|---|---|---|---|
| colorBack | Background color | string | Hex, RGB, or HSL color |
| colorFill | Shape fill color | string | Hex, RGB, or HSL color |
| colorStroke | Shape stroke color | string | Hex, RGB, or HSL color |
| shape | The shape type | enum | | "horizontal" | "vertical" | "diagonalForward" | "diagonalBack" | "cross" |
| size | Base size of each line, pixels | number | 1 to 100 |
| gapX | Pattern horizontal spacing, pixels | number | 2 to 500 |
| gapY | Pattern vertical spacing, pixels | number | 2 to 500 |
| strokeWidth | The outline stroke width, pixels | number | 0 to 50 |
| sizeRange | Random variation in shape size (0 = uniform size, higher = random value up to base size) | number | 0 to 1 |
| opacityRange | Random variation in shape opacity (0 = all shapes opaque, higher = semi-transparent dots) | number | 0 to 1 |
| rotation | Overall rotation angle of the graphics | number | 0 to 360 |
Description
Static grid pattern made of lines, horizontal, vertical, diagonal, cross.