Image Showcase

Example

Hello World
Hello World

Example 2

Hello World

Example 3

Hello World

Example 4

Example 5 no src

No Image Src

Example 6

Hello World
Hello World

Example 7

Hello World
Hello World

Component Documentation

Component Name

Image

Builder Function Name

create_image_manager

Description

renders an image with optional quick placeholder image, background blur, and loader, also dynamically calculates aspect ratio

Use like example

Config

PropertyTypeDefaultDescription
storage_pathstring

a template path for retrieving an image by storage_id, e.g. '/api/v1/storage/{storage_id}'

selector_idstring

optional identifier for referencing or targeting this image manager

bg_img_blurnumber

0

the background blur radius in pixels for the placeholder image

bg_img_opacitynumber

0

the background image's opacity (often used with blur)

altstring

alt text for the image

storage_idstring

storage id to replace in storage_path, if no direct src is provided

srcstring

the final url for the image; if null, tries to get from storage_path + storage_id

storage_id_quickstring

storage id for a quick/placeholder image

src_quickstring

a fast-loading low-res or placeholder image displayed behind and during loading

image_widthnumber

the image’s intrinsic width in px if known

image_heightnumber

the image’s intrinsic height in px if known

image_aspect_rationumber

aspect ratio (width / height). if null, calculates once image loads

display_max_widthnumber

800

the maximum display width in px

display_max_heightnumber

600

the maximum display height in px

border_radiusnumber

1

the border radius (in rem) for the container

Methods

MethodDescriptionParametersReturns
handle_mount

executes on svelte's onmount hook, checks if images are loaded, and sets their dimension info

No Params

void

Returned Properties

PropertyTypeDescription
idstring

unique internal id for this image instance

is_loading_main_imageboolean

indicates if the main high-res image is still loading

selector_idstring

optional external reference id for the image

srcstring

the actual url used for the main image

src_quickstring

url for a quick-loading placeholder image

altstring

alt text for the image

display_max_widthnumber

the maximum display width in px

display_max_heightnumber

the maximum display height in px

image_widthnumber

the actual image width in px after loading

image_heightnumber

the actual image height in px after loading

image_aspect_rationumber

width / height of the image (calculated after load if not provided)

bg_img_blurnumber

blur radius in px for the background placeholder

bg_img_opacitynumber

opacity for the blurred background

bg_img_stylestring

the background property used for the placeholder blur layer

border_radiusnumber

the border radius in rem for the container

icon
Sponsored byContibase