Tegaki handles text layout, line wrapping, and animation playback. See the framework guides for framework-specific setup.
import { TegakiRenderer } from 'tegaki';
import bundle from 'tegaki/fonts/caveat';
<TegakiRenderer
font={bundle}
time={{ mode: 'uncontrolled', speed: 1, loop: true }}
style={{ fontSize: 48 }}
>
Hello World
</TegakiRenderer>
<script>
import { TegakiRenderer } from 'tegaki/svelte';
import bundle from 'tegaki/fonts/caveat';
</script>
<TegakiRenderer
font={bundle}
text="Hello World"
time={{ mode: 'uncontrolled', speed: 1, loop: true }}
style="font-size: 48px"
/>
<script setup>
import { TegakiRenderer } from 'tegaki/vue';
import bundle from 'tegaki/fonts/caveat';
</script>
<template>
<TegakiRenderer
:font="bundle"
text="Hello World"
:time="{ mode: 'uncontrolled', speed: 1, loop: true }"
:style="{ fontSize: '48px' }"
/>
</template>
import { TegakiEngine } from 'tegaki/core';
import bundle from 'tegaki/fonts/caveat';
new TegakiEngine(document.getElementById('tegaki'), {
text: 'Hello World',
font: bundle,
time: { mode: 'uncontrolled', speed: 1, loop: true },
});
The component manages its own animation clock:
time: { mode: 'uncontrolled', speed: 2, loop: true }
Options:
speed — playback speed multiplier (default 1)
loop — restart when animation completes (default false)
playing — pause/resume (default true)
catchUp — speed up when buffered text is ahead (for streaming)
You provide the current time value directly (useful for syncing with external state):
time: 2.5 // seconds
// or
time: { mode: 'controlled', value: 2.5 }
Animation is driven purely by CSS (best performance, no JavaScript animation loop):
time: 'css'
// or
time: { mode: 'css' }
All frameworks accept the same effects configuration:
effects: {
glow: { radius: 8, color: '#00ccff' },
wobble: { amplitude: 1.5, frequency: 8 },
pressureWidth: { strength: 1 },
taper: { startLength: 0.15, endLength: 0.15 },
gradient: { colors: 'rainbow' },
}
Effects can also be set to true for defaults: { pressureWidth: true }.
For chat-like interfaces where text arrives incrementally, see Streaming Text.