Image (<disco-image>)
Image surface with secondary background, top indeterminate loading bar, and fade transitions.
Usage
<disco-image src="./favicon.svg" alt="Icon" fit="contain"></disco-image>
API
src(string): Image source URL.alt(string): Alt text.fit(cover|contain|stretch): Fit mode (coverdefault).ratio(string): Optional aspect ratio override (for example16 / 9).
Behavior
- Shows
--disco-background-secondarywhile loading. - Displays an indeterminate progress bar at the top during load.
- If loading ends mid-cycle, progress bar finishes its current indeterminate cycle before stopping.
- Fades image in when loaded.
- Crossfades when
srcchanges. - Uses loaded image intrinsic dimensions to set the host aspect ratio when
ratiois not set.