Skip to content
Twentyfirst UIHalo

Asset Card

Media · AssetCard

View as Markdown

A generated image or asset: its state (queued, generating, ready, failed), a watermark badge, the version stepper "‹ 2/3 ›", "Make current", "Regenerate" with a prompt and download.

  • versions are the asset's versions (src, prompt, state, error, downloadHref); version / onVersionChange control which one is shown (default the current one).
  • current marks the version in use; onMakeCurrent(index) shows "Make current" on the others.
  • state is a new generation's state and wins over the shown version's (the image area shimmers while generating, unless motion is reduced).
  • onRegenerate(prompt) opens a prompt field prefilled with the version's prompt (⌘/Ctrl+Enter sends, Esc cancels).
  • watermark (true or your text) puts a badge on the image; meta is the small line (size, cost).
Mug mockupWatermark
Mug mockupReady
2/3Current1024 × 1024 · €0.04
Generating
Tote bagGenerating
Started 12 s ago
The check found a person in the picture.
Shop windowFailed
Tote bag (bought)
Tote bag (bought)Ready
Current

Props

AssetCard

PropTypeNotes
surface?Surface`"glass"` for a translucent surface over a map, photo or video; `"solid"` opts out inside a glass provider.
titlestringRequired
alt?string
versionsAssetVersion[]Required
version?numberThe version shown (0-based); default the current one.
defaultVersion?number
onVersionChange?(index: number) => void
current?numberThe version in use (badge "Current").
onMakeCurrent?(index: number) => void
state?AssetStateThe state of a new generation (overrides the shown version's).
watermark?boolean | stringA badge on the image: `true` for "Watermark" or your text.
meta?ReactNode"1024 × 1024 · €0.04".
onRegenerate?(prompt: string) => voidShows Regenerate with a prompt field (prefilled with the version's prompt).
prompt?string
onDownload?(index: number) => voidWithout a version's `downloadHref`: Download calls this.
ratio?numberWidth / height of the image area (default 1).
error?string
actions?ReactNodeMore buttons in the action row.
className?stringExtra class on the root element.
style?CSSPropertiesInline style on the root element.