Provides a component for resolving and rendering media file thumbnail URLs.
Handles file type detection (image, video, PDF, document) and selects the appropriate thumbnail variant from the file's URL map.
Summary
Functions
Resolves the best thumbnail URL for a media file.
Resolves the best thumbnail URL for a media file.
Functions
Resolves the best thumbnail URL for a media file.
Returns nil when no suitable URL is available.
Examples
resolve_url(file) # small thumbnail
resolve_url(file, :medium) # medium preview
Resolves the best thumbnail URL for a media file.
Size modes:
:small(default) — tiny cells (list rows, selectors): prefers the baked Etcher thumbnail, then the 150px thumbnail:card— large grid/stack cards: prefers the baked Etcher thumbnail (400px), then the 300pxsmall, thenmedium; only after those falls back to the light 150px thumbnail, keeping the full-res original (which would force a live vector overlay) as the last resort:medium— for gallery/preview: prefers medium/thumbnail variants
Attributes
file- Media file map withfile_typeandurlsfields (required)size- Thumbnail size preference::small,:card, or:medium(default::small)
Examples
<.thumbnail_url file={file} :let={url}>
<img src={url} />
</.thumbnail_url>
<.thumbnail_url file={file} size={:medium} :let={url}>
<img src={url} />
</.thumbnail_url>Attributes
file(:map) (required)size(:atom) - Defaults to:small. Must be one of:small,:card, or:medium.
Slots
inner_block(required)