gpuikit 0.9.0

A UI toolkit for GPUI applications
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
//! Image element for markdown.

use gpui::{App, SharedString, Styled, img, prelude::*, px};

/// Render an image element.
///
/// Uses GPUI's `img` element to load and display images from URLs or data URIs.
pub fn image(src: impl Into<SharedString>, alt: Option<&str>, _cx: &App) -> impl IntoElement {
    // TODO: Handle alt text accessibility
    // TODO: Add loading/error states
    let _ = alt;

    let src: SharedString = src.into();
    img(src).max_w(px(600.0)).rounded(px(4.0))
}