Dot Grid
Installation
npm i @paper-design/shaders-react
Code
import { DotGrid } from '@paper-design/shaders-react';
<DotGrid
style={{ height: 500 }}
colorBack="#000000"
colorFill="#ffffff"
colorStroke="#ffaa00"
size={2}
gapX={32}
gapY={32}
strokeWidth={0}
sizeRange={0}
opacityRange={0}
shape="circle"
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 | | "circle" | "diamond" | "square" | "triangle" |
| size | Base size of each shape, 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 circles, diamonds, squares or triangles