< /___  \_?_ -  +_                               
 __—_{_#^ _ [_{ ##_                               
 /_?{{__   ^ \ }=                                 
?_>_}   /_\_ \   \                                
>^    ]__#!            _                          
___  [#/ > {  *— _     _                          
                                                  

ASCII art for React & Next.js. 332 FIGlet fonts you import like icons, a complete smushing engine, borders, shadows, gradients, eight animations and image-to-ASCII. Server Components by default — zero client JS unless you animate.

npm i @iwascreatedtocreate/asciikit
open playground →read the docs
332fonts
6+5smushing rules
8animations
15border styles
0 kbclient js (rsc)

quick start

works in server components, client components, node, bun, edge.

import { Ascii } from '@iwascreatedtocreate/asciikit/react';
import { Slant } from '@iwascreatedtocreate/asciikit/fonts';

export default function Page() {
  return <Ascii text="Hello" font={Slant} border="rounded" />;
}
╭─────────────────────────╮
│     __  __     ____     │
│    / / / /__  / / /___  │
│   / /_/ / _ \/ / / __ \ │
│  / __  /  __/ / / /_/ / │
│ /_/ /_/\___/_/_/\____/  │
│                         │
╰─────────────────────────╯

playground

every option, live. copy the code when it looks right.

ANSI Shadow · 7 rows · loading…
loading font…
import { Ascii } from '@iwascreatedtocreate/asciikit/react';
import { AnsiShadow } from '@iwascreatedtocreate/asciikit/fonts';

<Ascii text="Hello" font={AnsiShadow} />

fonts

332 of 332 · each one is its own tree-shakable import

effects

rendered on the server, animated by a tiny client component. frames never change size.

                                   
   —_ _      _{ #                  
 /_?{{ _   ^   }                   
 _>_}   /_\      \                 
                                   
animate="scramble"
                                              
                                              
                                              
                                              
                                              
animate="typewriter"
                         
                         
                         
                         
                         
animate="reveal"
               
               
               
               
               
animate="fall"
                         
                         
                         
                         
                         
animate="flicker"
       _ _ _      _    
  __ _| (_) |_ __| |_  
 / _` | | |  _/ _| ' \ 
 \__, |_|_|\__\__|_||_|
 |___/                 
animate="glitch"
                      
 __ __ ____ ___ _____ 
 \ V  V / _` \ V / -_)
  \_/\_/\__,_|\_/\___|
                      
animate="wave"
           _      
  _ _ __ _(_)_ _  
 | '_/ _` | | ' \ 
 |_| \__,_|_|_||_|
                  
animate="rain"
     _            _
  __| |_  __ _ __| |_____ __ __
 (_-<░'░\/ _` / _`░/░_░\░V ░V /░
 /__/_||_\__,_\__,_\___/\_/\_/ ░
  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
shadow
      _ _ __
 __ _(_) |_ \
/ _` | | |_  |
\__. |_|_| |_|
   |_|
flip="horizontal"
   ██ █ █ █
  █ ████ █ █
 █  ██ █ █ █
 ███ ███████
fill="█"
██████████████████████████
███ █████████████████ ████
██    █   █     █ █  █  ██
██ █ █ █ █ █ █   █   ██  █
██                 ██    █
██████████████████████████
██████████████████████████
invert

spinners

<AsciiSpinner spinner="dots" />

-line
⠋dots
⣾dots2
⡀braille
┤pipe
◜arc
◐circle
◰square
◢triangle
⠁bounce
✶star
←arrow
⊶toggle
▁grow
[ ]bar
▐⠂ ▌pong
ellipsis
█blink

boxes

<AsciiBox variant="double" title="…">

┌─ single ────┐
│             │
│  build      │
│  something  │
│  weird      │
│             │
└─────────────┘
╔═ double ════╗
║             ║
║  build      ║
║  something  ║
║  weird      ║
║             ║
╚═════════════╝
╭─ rounded ───╮
│             │
│  build      │
│  something  │
│  weird      │
│             │
╰─────────────╯
┏━ heavy ━━━━━┓
┃             ┃
┃  build      ┃
┃  something  ┃
┃  weird      ┃
┃             ┃
┗━━━━━━━━━━━━━┛
┌╌ dashed ╌╌╌╌┐
╎             ╎
╎  build      ╎
╎  something  ╎
╎  weird      ╎
╎             ╎
└╌╌╌╌╌╌╌╌╌╌╌╌╌┘
+- ascii -----+
|             |
|  build      |
|  something  |
|  weird      |
|             |
+-------------+

image → ascii

ramps, braille, edge tracing, dithering. runs in the browser, or on the server with pixelsToAscii().

docs

everything is typed. hover anything in your editor.

install

npm i @iwascreatedtocreate/asciikit      # or pnpm add / yarn add / bun add

Three entry points: @iwascreatedtocreate/asciikit (framework-free core), @iwascreatedtocreate/asciikit/react (components & hooks) and @iwascreatedtocreate/asciikit/fonts (one export per font).

<Ascii />

import { Ascii } from '@iwascreatedtocreate/asciikit/react';
import { Slant, AnsiShadow } from '@iwascreatedtocreate/asciikit/fonts';

<Ascii text="Hello" />                                   // Standard font built in
<Ascii text="Hello" font={Slant} size={10} />
<Ascii text="Hello" font={AnsiShadow} gradient="silver" glow />
<Ascii text="Hi" font={Slant} border={{ style: 'double', title: 'v1' }} shadow />
<Ascii text="Boot" font={AnsiShadow} animate="scramble" />
<Ascii as="h1" text="Title" label="Title" />                // semantic + accessible
proptypedescription
text | childrenstringtext to render
fontFontDefinition | stringimported font, raw .flf text or registered name
horizontalLayout'default' | 'full' | 'fitted' | 'smush' | 'universal-smush'how glyphs meet
verticalLayoutsame as abovehow lines meet
horizontalRules / verticalRules{ equal, underscore, hierarchy, … }toggle individual smushing rules
widthnumberword-wrap at N columns
align'left' | 'center' | 'right'line alignment
letterSpacing / wordSpacing / lineGapnumberspacing in columns / rows
direction'ltr' | 'rtl'override font direction
fillstringreplace every visible char (e.g. █)
replaceRecord<string, string>char replacement map
borderboolean | BoxStyle | BoxOptions15 styles, title, footer, padding
shadowboolean | { x, y, char }drop shadow
flip / rotate / scale / invert…geometric transforms
paddingnumber | { x, y, top, … }blank space around
transform(art) => stringyour own post-processing
color / gradient / gradientDirectionstring | string[] | presetCSS color or background-clip gradient
size / lineHeight / fontFamily / glow…typography
animateeffect | { effect, duration, loop, trigger, … }see animation
as / labelElementType / string | falseelement & aria-label

Make your own reusable component, lucide-style:

import { createAscii } from '@iwascreatedtocreate/asciikit/react';
import { Slant } from '@iwascreatedtocreate/asciikit/fonts';

export const Logo = createAscii('ACME', { font: Slant, gradient: 'mono' });
// <Logo size={8} />

fonts

332 fonts, each in its own module. Import by name from the barrel (tree-shaken), by path, or load on demand.

import { Slant, Doom, Graffiti } from '@iwascreatedtocreate/asciikit/fonts';     // tree-shakable barrel
import Ghost from '@iwascreatedtocreate/asciikit/fonts/ghost';                    // direct path
import { loadFont } from '@iwascreatedtocreate/asciikit/fonts/lazy';              // code-split, async
import { fontList } from '@iwascreatedtocreate/asciikit/fonts/meta';              // names & sizes, no glyph data

const font = await loadFont('ANSI Shadow');                  // id or display name

// in client components
import { useFont } from '@iwascreatedtocreate/asciikit/react';
const { font, loading } = useFont('ansi-shadow');

// register for string lookup
import { registerFont, setDefaultFont } from '@iwascreatedtocreate/asciikit';
registerFont(Slant);  render('hi', { font: 'slant' });
setDefaultFont(Doom);

// bring your own .flf / .tlf
import { parseFont } from '@iwascreatedtocreate/asciikit';
const mine = parseFont(await (await fetch('/my.flf')).text());

layout & smushing

A full FIGfont 2 engine: full width, fitting (kerning), controlled smushing with all six horizontal rules (equal, underscore, hierarchy, opposite pair, big X, hardblank) and universal smushing — plus the five vertical rules for multi-line text. Output matches figlet.js / TAAG for 97%+ of fonts.

render('Hello', { font: Standard, horizontalLayout: 'fitted' });
render('Hello', { font: Standard, horizontalRules: { hierarchy: false } });
render('two\nlines', { font: Standard, verticalLayout: 'smush' });
render('a long sentence', { font: Standard, width: 60, align: 'center' });

effects

Pure string functions — chain them with pipe(), use them in CLIs, emails, logs.

import { render, pipe, box, shadow, fill, flipHorizontal, rotate, scale,
         invert, pad, trim, join, stack, overlay, toAnsi, toHTML } from '@iwascreatedtocreate/asciikit';

const art = pipe(
  render('OK', { font: Slant }),
  (a) => fill(a, '█'),
  (a) => shadow(a, { char: '░' }),
  (a) => box(a, { style: 'rounded', title: 'status', padding: 1 }),
);

console.log(toAnsi(art, { gradient: 'sunset' }));     // 24-bit terminal colors
join([logo, info], { gap: 4, align: 'middle' });         // side by side

animation

scramble typewriter reveal fall flicker glitch wave rain. Respects prefers-reduced-motion.

<Ascii text="Hi" animate="glitch" />
<Ascii text="Hi" animate={{ effect: 'scramble', duration: 2000, delay: 300,
  loop: true, loopDelay: 1500, trigger: 'visible' /* | 'mount' | 'hover' */ }} />

// framework-free: compute any frame yourself
import { animationFrame } from '@iwascreatedtocreate/asciikit';
const frame = animationFrame(art, 'typewriter', 0.5);

image → ascii

import { AsciiImage } from '@iwascreatedtocreate/asciikit/react';

<AsciiImage src="/me.jpg" columns={100} mode="braille" dither="atkinson" />
<AsciiImage src={file} charset="blocks" color invert contrast={1.4} />

// server / node: decode pixels however you like (sharp, canvas…)
import { pixelsToAscii } from '@iwascreatedtocreate/asciikit';
const { text } = pixelsToAscii({ data, width, height }, { columns: 80 });

core api

import { render, renderLines, ascii } from '@iwascreatedtocreate/asciikit';

render(text, options)        // string — FIGlet rendering
renderLines(text, options)   // string[]
ascii(text, options)         // render + transforms (fill, border, shadow…)
textSync(text, options)      // figlet.js-compatible alias

next.js tips

<Ascii> renders on the server, so fonts never reach the browser. When you animate, only the final string is sent to the client. For font pickers use useFont() so each font is its own chunk. Optional:

// next.config.js — faster dev builds when importing many fonts from the barrel
experimental: { optimizePackageImports: ['@iwascreatedtocreate/asciikit'] }