Skip to content
Sign in
EffectsASCII 3DMenu

ASCII 3DPro

A rotating torus, cube, octahedron or your logo extruded from an SVG path, drawn as ASCII in the donut.c tradition but ray marched per cell, throttled to about 20 fps.

ProA torus, a cube, an octahedron or the logo, ray marched per cell and drawn as text at 20 fps. Drag it, flick it, or use the arrow keys.

Installation

$ pnpm dlx shadcn@latest add @chatcn-pro/ascii-3d

Usage

tsx
import { Ascii3D } from "@/components/ui/chatcn/pro/ascii-3d"

<Ascii3D shape="torus" columns={64} />
<Ascii3D shape={{ path: logoPath, viewBox: [0, 0, 32, 32] }} aspectRatio={2} zoom={1.5} />

A path is rasterized once into a signed distance field, fitted to its inked bounds and extruded, so any single color logo works. Paths sway either side of facing you by default, so the mark stays legible; shapes tumble. The text is a real <pre> that updates in place.

Examples

Logo and sizes

ProThe logo extruded as a hero object, large glyphs, a slow turntable, and a custom ramp held paused.

Props

PropTypeNotes
shape"torus" | "cube" | "octahedron" | { path, viewBox? }Default torus
labelstringAccessible name. Defaults to the shape, for example A rotating torus drawn in ASCII
columnsnumberCharacters across. Default 64
aspectRationumberWidth over height. Default 1
motion"tumble" | "turntable" | "sway"Default tumble, or sway for paths
speed, zoom, depthnumberDefaults 1, 1 and 0.4
rampstringDark to lit. Default .,-~:;=!*#$@
fpsnumberDefault 20
interactivebooleanDrag, flick and arrow keys. Default true
still{ pitch, yaw }The pose held under reduced motion
paused, defaultPaused, onPausedChange, pauseControlPause control as every effect

Keyboard

KeyAction
TabFocuses the object, then the pause button
ArrowLeft, ArrowRightTurn it 15 degrees, at once
ArrowUp, ArrowDownTilt it 15 degrees, at once

Accessibility

  • The object is role="img" with your label and a hint to drag or use the arrow keys; the characters are hidden from screen readers.
  • Glyphs are text in currentColor, so forced colors and high contrast render them with system colors.
  • Drags use pointer capture and touch-action: none only on the object, so the page still scrolls around it.

Motion

  • Turns at about 20 fps through the shared frame clock, paused offscreen and in hidden tabs.
  • A flick keeps spinning and decays back into the steady turn, critically damped, with no overshoot.
  • Under reduced motion it holds one still pose; a drag still turns it, since the person moves it.
  • Arrow keys step the pose without animating.