Skip to main content

euv_ui/component/image/view/
struct.rs

1use super::*;
2
3/// Props for the [`euv_image`] component.
4///
5/// Defines the strongly-typed interface for a picture: where it comes
6/// from, what it says, the box it should occupy, and the text shown
7/// while it loads or if it fails.
8#[derive(Clone, CustomDebug, Default)]
9pub struct EuvImageProps {
10    /// The image source URL.
11    pub src: &'static str,
12    /// The alternative text, read by screen readers.
13    pub alt: &'static str,
14    /// The text shown while the picture loads and when it fails.
15    ///
16    /// An empty string renders the picture with no placeholder.
17    pub placeholder: &'static str,
18    /// The explicit width in pixels, when the caller wants one.
19    pub width: Option<u32>,
20    /// The explicit height in pixels, when the caller wants one.
21    pub height: Option<u32>,
22}