Simon Willison · · 1 min read

<click-to-play> — a still that plays

Mirrored from Simon Willison for archival readability. Support the source by reading on the original site.

17th June 2026

A progressive enchantment Web Component that turns this markup:

<click-to-play>
  <a href="URL to GIF">
    <img src="URL to first frame" alt="...">
  </a>
</click-to-play>

Into a still frame with a click to play button which loads the GIF on demand. For when you don't want big GIFs to be loaded unless people want to play them.

Here's an example that demonstrates the new row editing tools in Datasette - in fact I built this Web Component for that post.

Posted 17th June 2026 at 3:56 am

Recent articles

This is a beat by Simon Willison, posted on 17th June 2026.

gif 6 javascript 758 progressive-enhancement 14 web-components 23

Monthly briefing

Sponsor me for $10/month and get a curated email digest of the month's most important LLM developments.

Pay me to send you less!

Discussion (0)

Sign in to join the discussion. Free account, 30 seconds — email code or GitHub.

Sign in →

No comments yet. Sign in and be the first to say something.

More from Simon Willison