Modus UI

ASCII Flow

Web (React)

Flowing fractal noise rendered as ASCII characters in your theme colours.

Fractal noise drawn in your theme's background and primary tokens, converted into ASCII character art. It fills its positioned parent and freezes its animation when the user prefers reduced motion. Built on the shaders library (MIT) and rendered with WebGPU.

ASCII Flow

Installation

CLI

npx @modus-ui/cli add ascii-flow

Manual

  1. Install shaders with npm install shaders.
  2. Copy the code from the component tab.
  3. Create a file at components/ui/ascii-flow.tsx.
  4. Paste the code.

Usage

tsx
import { AsciiFlow } from "@/components/ui/ascii-flow";

export default function Example() {
  return (
    <div className="relative h-[500px] w-full overflow-hidden">
      <AsciiFlow />
      <div className="relative z-10 p-8">
        <h1>Content over the effect</h1>
      </div>
    </div>
  );
}

Props

PropTypeDefaultDescription
colorAstringtheme tokenDark colour. Defaults to the --background token.
colorBstringtheme tokenLight colour. Defaults to the --primary token.
charactersstring" .:-=+*#%@"Characters from darkest to brightest.
cellSizenumber16Character cell size in pixels.
speednumber0.4Noise animation speed.
contrastnumber1.2Noise contrast.

Comments

  • No comments yet.