Updated
Riso Flow
Customize
Color
Scale1.00
Offset4.0px
Dot2.0px
Grit0.55
Paper1.0
Speed1.0
Seed0
Shake1.00
Installation
npx shadcn@latest add https://uibrik.com/r/riso-flow.jsonAdd the cn helper
Imports
cnfrom@/lib/utils, whichshadcn initcreates. Add it by hand without shadcn.Copy the source into your project
components/uibrik/riso-flow/riso-flow.tsx"use client"; import type { CSSProperties, ReactNode } from "react"; import { ShaderSurface } from "../_shader-background/ShaderSurface"; import { shadesOf, type ShadeStep } from "../_shader-background/shades"; // A flowing gradient printed on a risograph. The first colour is the paper; up to three more are // spot inks, each laid down as its own layer of loose grain whose density follows a slow, // self-warping noise field. The layers sit slightly out of register, drifting a few px apart and // back, and overprint by multiplying, so where two inks meet a third colour appears. // // Moving the pointer leaves a short wake where the layers slip apart and settle back. A press sends a ring out // through the sheet that shoves the layers apart and prints a little heavier as it passes. const SHADER = /* glsl */ ` uniform float u_scale; // size of the shapes uniform float u_offset; // misregistration, css px uniform float u_dot; // grain size, css px uniform float u_grit; // 0 crisp grain .. 1 soft uniform float u_paper; // paper texture strength uniform float u_shake; // how far the wake and presses push the layers apart float fbm(vec3 p) { float sum = 0.0; float amp = 0.5;
Adds the files to
components/uibrik/riso-flow. With the @uibrik namespace set up: npx shadcn@latest add @uibrik/riso-flow.Too large to paste whole, so Copy prompt gives a short prompt that installs it with the CLI. Download the full prompt to attach it instead.
Usage
import { RisoFlow } from "@/components/uibrik/riso-flow/riso-flow";<RisoFlow color="#1f7a8c" scale={1} offset={4} dot={2} grit={0.55} paper={1} speed={1} seed={0} interactive shake={1} animate> …</RisoFlow>Where to use Riso Flow
Editorial and zine sites
Grainy overprinted ink gives pages a printed, handmade feel.
Pairs with Halftone
Event and poster pages
Fluorescent spot inks read like a gig poster or festival flyer.
Studio portfolios
A warm analogue texture behind work that should not look like a template.
Pairs with Dither Gradient
Props
RisoFlow- color
- Type string
- "#1f7a8c"
- Colour of the ink; the paper and other inks are shades of it.
- scale
- Type number
- 1
- Size of the shapes; larger is calmer.
- offset
- Type number
- 4
- How far the ink layers drift out of register.
- dot
- Type number
- 2
- Size of a grain speck.
- grit
- Type number
- 0.55
- Softness of the grain; 0 is crisp.
- paper
- Type number
- 1
- Strength of the paper texture.
- speed
- Type number
- 1
- Animation speed; 1 is the designed pace.
- seed
- Type number
- 0
- Shifts the composition, so two backgrounds with the same settings still differ.
- interactive
- Type boolean
- true
- Moving the pointer leaves a misregistered wake; a press sends a ring through the sheet.
- shake
- Type number
- 1
- How hard the wake and presses push the layers apart.
- animate
- Type boolean
- true
- Move on its own. Off draws one still frame.
- children
- Type ReactNode
- –
- Content shown on top of the background.
- className
- Type string
- –
- Classes for the box; it fills whatever size you give it.