Skip to content

MediaFrame

Stable

An image in a fixed shape, with a placeholder while it loads, a message if it fails, and an optional caption and AI label.

Also known as image, aspect ratio, image frame, thumbnail

Install with npm install @tattva/ui (setup), or copy the code from the kit in Downloads.

Ratios

Harbor at low tide
1:1
Terraced hillside
4:3
Quiet street
16:9
Lake under cloud
3:2

Pick the shape that fits the content. The frame crops the image to fill it.

When to use it

Shows an image without making the page jump. It saves the space first, fills it with a placeholder, and offers Retry if the image fails.

Made of: Frame · Placeholder · Image · Error message · AI label · Caption

Use it for

  • A photo or generated image in a reply or a card.
  • An image that may load slowly or fail.
  • An AI-made image that needs a label saying where it came from.

Not for

Do and avoid

Harbor at low tide with three boats
AI-generated
Cover for the Lisbon guide
Do. A set shape and a clear AI label say what people are seeing.
Harbor at low tide with three boats
Cover for the Lisbon guide
Avoid. With the AI label gone, people may think the photo is real.

Do

  • Describe what the image shows.
  • Give the main color when you have it, so the placeholder matches the image.
  • Label AI-made images with the visible AI label.
  • Use one shape for a group of images.

Avoid

  • Do not use the AI request as the image description. Describe what is in the picture.
  • Do not leave out the description unless the image is only decoration.
  • Do not hide the AI label to make an image look cleaner.
  • Do not let images pick their own size. Without a set shape, the page jumps.

On a phone

  • The frame fills the width of its container and keeps its ratio, so the height follows the width.
  • The AI label sits at the bottom left of the image, and with provenance it opens a popover from a button that has a 44px tap area on touch screens.
  • The Retry button keeps its size on touch screens and has a 44px tap area. Keep errorLabel short so the error tile fits a small frame.

Seen in products

  • ThumbHash and BlurHash placeholders encode an image into a few bytes. A 1x1 BlurHash is the average color, which is enough to reserve layout, and explicit dimensions prevent layout shift.
  • Major image generators embed C2PA or IPTC metadata and SynthID is an invisible watermark. The best practice reported is a visible human label plus machine-readable metadata.
  • Adobe Content Credentials uses three levels of progressive disclosure: a small cr icon, then a popover with creator, date and tool, then full provenance.

Build your next AI screen with Tattva.

Free and open, with the code. Start in one line.

Get started