Paper Texture

Click to change the sample image

Installation

npm i @paper-design/shaders-react

Code

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

<PaperTexture
  style={{ height: 500 }}
  colorBack="#ffffff"
  colorFront="#9fadbc"
  contrast={0.3}
  roughness={0.4}
  fiber={0.3}
  fiberScale={1}
  crumples={0.3}
  crumplesScale={0.6}
  folds={0.65}
  foldsNumber={5}
  blur={0}
  drops={0.2}
  seed={5.8}
  scale={0.6}
  fit="cover"
/>

Props

NameDescriptionTypeValues
colorBackBackground colorstringHex, RGB, or HSL color
colorFrontThe foreground colorstringHex, RGB, or HSL color
contrastBlending behavior (sharper vs. smoother color transitions)number0 to 1
roughnessPixel noise, related to canvas (not scalable)number0 to 1
fiberCurly-shaped noisenumber0 to 1
fiberScaleCurly-shaped noise scalenumber0.1 to 2
crumplesCell-based crumples patternnumber0 to 1
crumplesScaleCell-based crumples pattern scalenumber0.3 to 3
foldsDepth of the foldsnumber0 to 1
foldsNumberNumber of folds (15 max)number1 to 15 (integer)
blurBig-scale noise mask applied to everything but roughnessnumber0 to 1
dropsThe visibility of speckle patternnumber0 to 1
seedSeed applied to folds, crumples and dotsnumber0 to 1000
scaleOverall zoom level of the graphicsnumber0.5 to 10
fitHow the image fits the canvasenum
| "contain" | "cover"

Description

A static texture built from multiple noise layers, usable for a realistic paper and cardboard surfaces or generating abstract patterns. Can be used as a image filter or as a texture.