Skip to content

ButterIX v1 is out: versions, multiple languages, Ask AI, and a per-site MCP server, all built in. →

Live Photo

<LivePhoto> works like a Live Photo on iPhone: it shows the photo, and plays the video when you press and hold it or click the badge.

Pair a photo with a short video (usually about 3 seconds). The photo is shown with a Live badge in the top-left corner:

  • Press and hold the photo: the video plays from the start, stops when you let go, and fades back to the photo.
  • Click the badge: plays the video once; click again to stop. You can also focus the badge with the keyboard and press Enter or Space.
<LivePhoto src="/assets/media/live.jpg" video="/assets/media/live.mp4" alt="A fractal slowly zooming in" />
A fractal slowly zooming in

Take the photo from a frame in the middle of the video so the fade back at the end looks natural. The video loads as the component scrolls near, so it plays the moment you press. If the browser doesn't allow playback with sound, it plays muted.

srcurlRequired
The photo (photo and image also work).
videourlRequired
The video file; MP4 (H.264) of a few seconds is best.
altstring
Alternative text for the photo.
widthstring
Display width: a number in pixels or a CSS length. Defaults to the full content width.
mutedbooleanDefault false
Play without sound.