-
Notifications
You must be signed in to change notification settings - Fork 9
Component Image
MeowLynxSea edited this page Jan 24, 2026
·
5 revisions
Displays an image with loading + fallback placeholders.
Image supports two sources:
- Embedded
Arc<gpui::Image> - A file path (
PathBuf)
use std::sync::Arc;
use gpui::Image;
use yororen_ui::component::image;
let img: Arc<Image> = yororen_ui::component::image_from_bytes(vec![]);
let view = image(img);- Thumbnails and content images
- Displaying local images from a file path
-
image(source): constructor (sourcecan beArc<Image>orPathBuf) -
fit(ImageFit):-
Contain(default) Cover
-
Helper:
-
image_from_bytes(Vec<u8>) -> Arc<Image>: convenience to build a PNG image
- The view uses
with_loading(...)andwith_fallback(...)placeholders.
- Fit:
ImageFit::Contain - Placeholder background:
theme.surface.sunken
Yororen UI v0.3.0 · repository · Apache-2.0 · This wiki documents Yororen UI v0.3.0.
This wiki documents Yororen UI v0.3.0 — the headless-core, swappable-renderer build.