Skip to content

gkurt/tegaki

Repository files navigation

Tegaki

Handwriting animation for any font

Tegaki (手書き) turns any font into animated handwriting. No manual path authoring. No native dependencies. Just pick a font.

npm license


Tegaki is awesome handwriting animation


Quick Start

1. Install

npm install tegaki

2. Use (React example)

import { TegakiRenderer } from 'tegaki';
import caveat from 'tegaki/fonts/caveat';

function App() {
  return (
    <TegakiRenderer font={caveat} style={{ fontSize: '48px' }}>
      Hello World
    </TegakiRenderer>
  );
}

That's it. The text draws itself stroke by stroke with natural timing.

Command Line

Don't want to wire up a component? Generate an animated handwriting SVG straight from your terminal — nothing to install:

npx tegaki "Tegaki is awesome"

This writes a self-drawing, looping tegaki-is-awesome.svg — drop it into a README, a slide, or any page. Pick a font, mode, size, or color:

npx tegaki "Hello World" --font tangerine --mode once -o hello.svg
npx tegaki "ABC" --stagger 80% --size 140 --color "#222"

--mode is loop (repeats forever, the default), once (draws itself a single time), or static (finished artwork). Run npx tegaki --help for every option and --list-fonts for the bundled fonts. The CLI emits SVG only — for PNG, GIF, or WebM use the interactive studio.

Framework Support

Tegaki works with all major frameworks:

import { TegakiRenderer } from 'tegaki/react';   // React
import { TegakiRenderer } from 'tegaki/svelte';  // Svelte
import { TegakiRenderer } from 'tegaki/vue';     // Vue
import { TegakiRenderer } from 'tegaki/solid';   // SolidJS
---
import TegakiRenderer from 'tegaki/astro';       // Astro
---
import { TegakiEngine } from 'tegaki/core';      // Vanilla JS
import { registerTegakiElement } from 'tegaki/wc'; // Web Components

Built-in Fonts

Several handwriting fonts are bundled and ready to use:

  • Caveattegaki/fonts/caveat (Latin)
  • Italiannotegaki/fonts/italianno (Latin)
  • Tangerinetegaki/fonts/tangerine (Latin)
  • Parisiennetegaki/fonts/parisienne (Latin)
  • Suez Onetegaki/fonts/suez-one (Hebrew + Latin)
  • Amiritegaki/fonts/amiri (Arabic + Latin)
  • Tillanategaki/fonts/tillana (Devanagari + Latin)
  • Klee Onetegaki/fonts/klee-one (Japanese: kana + Kyōiku grade 1–2 kanji + Latin)
  • Nanum Pen Scripttegaki/fonts/nanum-pen-script (Korean: Hangul syllables + jamo + Latin)

For other fonts, use the interactive studio to create a custom bundle.

Documentation

Visit gkurt.com/tegaki for full documentation:

Integrations

License

MIT

About

Handwriting animation for the web. Supports any font or text.

Topics

Resources

License

Contributing

Stars

3k stars

Watchers

9 watching

Forks

Packages

 
 
 

Contributors