Zach’s ugly mug (his face) Zach Leat­herman

How to Hallucinate using Web Components

00 November 21, 2025

Say, you want the smooth convenience of consuming content that feels like it’s generated in real time without having to deal with the tradeoffs of a Large Language Model née Artificial Intelligence.

Why not use animation? It’s the perfect metaphor for a Hollywood-esque veneer of complexity without substance, in no way similar to how an entire industry is currently being oversold and at no risk of imminent collapse.

This approach animates each blog post’s content (already generated by a human, manually) progressively to emulate existing chatbox user experience patterns for hallucinating text. You can try it out right now by hitting the Hallucinate toggle above.

How does it work?

This makes use of the <squirm-inal> Web Component, originally for Netlify’s Your Year on Netlify microsite and using lessons learned from Queue Code (a way to live code without live coding).

// It works with any arbitrary HTML content
// including this syntax highlighted code block
"use AI"

To implement this yourself, just wrap any arbitrary content (say <main>) in a newly created <squirm-inal autoplay speed="0.6"> element and you’re off to the races.

<script
	src="https://unpkg.com/@zachleat/squirminal@3.0.1/squirminal.js"
	integrity="sha384-m+pplzdzdfZuwjyxmM9pOkp/ALfMMjZll/b2g2mR6mhurvj1ZZAe8xXNj7BSp4XM"
	crossorigin="anonymous"></script>
<script type="module">
let main = document.querySelector("main");
let squirm = document.createElement("squirm-inal");
squirm.setAttribute("speed", "0.6");
squirm.setAttribute("autoplay", "");
squirm.append(...main.children);
main.append(squirm);
</script>

You could swap the <script src> above to use import() instead but that would remove the option for subresource integrity (always important for CDN use).

That’s it!


Older >
How we use GitHub Issues (on 11ty) and how that’s Changing

Zach Leatherman IndieWeb Avatar for https://zachleat.com/is a builder for the web at Font Awesome and the creator/maintainer of IndieWeb Avatar for https://www.11ty.devEleventy (11ty), an award-winning open source site generator. At one point he became entirely too fixated on web fonts. He has given 86 talks in nine different countries at events like Beyond Tellerrand, Smashing Conference, Jamstack Conf, CSSConf, and The White House. Formerly part of CloudCannon, Netlify, Filament Group, NEJS CONF, and NebraskaJS. Learn more about Zach »

Shamelessly plug your related post

These are webmentions via the IndieWeb and webmention.io.

Sharing on social media?

This is what will show up when you share this post on Social Media:

How did you do this? I automated my Open Graph images. (Peer behind the curtain at the test page)