Glows, gradients, tapered ends and the rest are plugins. Import the factories from tegaki and pass the plugins in a list:
import { glowPlugin, strokeGradientPlugin, TegakiRenderer } from 'tegaki';// Outside the component, so the list stays the same from render to render.const plugins = [strokeGradientPlugin(), glowPlugin({ radius: 0.1, color: '#00ccff' })];<TegakiRenderer font={bundle} time={{ mode: 'uncontrolled', speed: 1, loop: true }} plugins={plugins} style={{ fontSize: 48 }}> Glowing rainbow</TegakiRenderer>
Loading...
A new list of new plugins on every render redraws the canvas, so define it outside the component or in useMemo. Registered plugins can also be named (plugins={['taper', ['glow', { radius: 0.1 }]]}), and a list of names is fine inline. See Style plugins and Naming plugins. The pressure prop (0 to 1, default 1) sets how much the ink’s width follows the pen’s pressure.