Introduction
GPU effects for real HTML. Keep your content, add an edge.
domfx adds GPU edge effects to the visible shape of a DOM element. Your text stays selectable, your buttons keep their handlers, and your links keep working. The effect lives in a separate canvas alongside the original content.
domfx is experimental. Version
0.1.0-alpha.2is available on npm. Start with the installation guide.
Start with your element
Section titled “Start with your element”The target element is the text, button, image or card whose shape receives
the effect. The effect container (host) holds that element and the decorative
canvas; give it CSS position: relative. domfx keeps the original content in place.
Follow Installation and Standalone to build a complete app: a button with flames and a working click counter.
Start with GSAP
Section titled “Start with GSAP”If you already use GSAP, follow the complete GSAP recipe: attach an effect to the same button, animate it with your own timeline, seek, reverse and clean up. Install the alpha first.
Control animation
Section titled “Control animation”- Standalone: use automatic animation, or control effect time with your own code.
- GSAP: animate an effect with your own timeline. Animate effect time and intensity alongside the rest of your sequence.
Choose an effect
Section titled “Choose an effect”Choose from Electricity, Frost, Fire, Slime, Burned paper, Kinetic bloom and the
pattern effects in the effects gallery. Every attachment returns an
effect instance (EffectHandle) with time, intensity, refresh and disposal controls. See
available attachments for each import name.
The Standalone guide uses Fire for its interactive example. Its intensity and playback controls apply to every effect.
Keep the original usable
Section titled “Keep the original usable”The effect is optional decoration. Missing WebGPU, reduced motion or unsupported capture conditions leave the original DOM available. Inspect the effect’s state and reason code, and release it when your page or component goes away.
See the API reference for the public contract, browser support for measured limits, and troubleshooting for unavailable output.