ASCII Render

About this component

ASCII Render

A live WebGL scene drawn entirely in characters: a turning form is raymarched into a small grid, one cell per glyph, then printed from a monospace glyph ramp over drifting noise and a slow scan line, with cells lighting up in the accent color around the cursor. Colors, glyph ramp, cell size, form, placement, size, spin, speed, drift, scan line, contrast and the cursor glow are all props. Colors follow the theme, cells grow on slower devices, it pauses offscreen, holds a still frame for reduced motion and falls back to a dot field without WebGL.

Usage

The import and the props worth knowing about, in one place.

import { AsciiRender } from "@/components/beste/component/ascii-render";

// As a layer behind content
<section className="relative min-h-[40rem]">
  <AsciiRender className="absolute inset-0" align="right" />
  <div className="relative">...</div>
</section>

<AsciiRender
  className="min-h-[32rem]"
  inkColor="var(--foreground)"  // any CSS color, tokens included
  accentColor="var(--primary)"
  glyphs=" .,:;ox%#@"           // darkest to brightest
  cellSize={12}                 // cell height in pixels
  scene="torus"                 // "lattice" (default) | "sphere" | "torus" | "asterisk"
  align="right"                 // "left" | "center" (default) | "right"
  spin={0.6}                    // how fast the form turns
  scanLine={false}
/>

Props

Read from the component's own type, so this cannot drift from what it accepts.

PropTypeDefaultDescription
inkColorstring—Color of the glyphs. Any CSS color, tokens included.
paperColorstring—Color behind the glyphs.
accentColorstring—Color the brightest glyphs and the cursor glow take on.
glyphsstring—Glyph ramp from darkest to brightest.
cellSizenumber—Height of one character cell in CSS pixels.
scene"lattice" | "sphere" | "torus" | "asterisk"—The form drawn in characters.
align"left" | "center" | "right"—Where the form sits across the surface.
sizenumber—Size of the form, 0 to 1.
spinnumber—How fast the form turns, 1 is the default pace.
speednumber—Overall motion speed, 1 is the default pace.
driftnumber—Drifting noise in the empty field, 0 to 1.
scanLineboolean—A slow scan line sweeps down the surface.
contrastnumber—Brightness and punch of the form, 0 to 1.
interactiveboolean—Cells light up around the cursor.
glownumber—Strength of that glow, 0 to 1.
glowSizenumber—Size of that glow, 0 to 1.
pausedboolean—Freeze the surface on its current frame.
classNamestring—
childrenReactNode—

More Media components

View all Media
A modern house with wide glass walls and a pool
A model in wide striped trousers leaning on a teal wall