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.
Two size modes:
:small(default) — for selectors and grids: prefers thumbnail/small variants:medium— for gallery/preview: prefers medium/thumbnail variants
Attributes
file- Media file map withfile_typeandurlsfields (required)size- Thumbnail size preference::smallor: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, or:medium.
Slots
inner_block(required)