pub struct ImageProps {Show 14 fields
pub src: String,
pub alt: Option<String>,
pub width: Option<String>,
pub height: Option<String>,
pub fallback: Option<String>,
pub placeholder: Option<Element>,
pub preview: bool,
pub preview_config: Option<PreviewConfig>,
pub on_load: Option<EventHandler<()>>,
pub on_error: Option<EventHandler<()>>,
pub class: Option<String>,
pub style: Option<String>,
pub image_class: Option<String>,
pub image_style: Option<String>,
}Expand description
Props for the Image component.
Fields§
§src: StringImage source URL.
alt: Option<String>Alt text for the image.
width: Option<String>Width of the image.
height: Option<String>Height of the image.
fallback: Option<String>Fallback image source if main source fails.
placeholder: Option<Element>Placeholder element shown while loading.
preview: boolWhether to enable preview on click.
preview_config: Option<PreviewConfig>Preview configuration.
on_load: Option<EventHandler<()>>Callback when image loads successfully.
on_error: Option<EventHandler<()>>Callback when image fails to load.
class: Option<String>Extra class for the root element.
style: Option<String>Inline style for the root element.
image_class: Option<String>Extra class for the image element.
image_style: Option<String>Inline style for the image element.
Implementations§
Source§impl ImageProps
impl ImageProps
Sourcepub fn builder() -> ImagePropsBuilder<((), (), (), (), (), (), (), (), (), (), (), (), (), ())>
pub fn builder() -> ImagePropsBuilder<((), (), (), (), (), (), (), (), (), (), (), (), (), ())>
Create a builder for building ImageProps.
On the builder, call .src(...), .alt(...)(optional), .width(...)(optional), .height(...)(optional), .fallback(...)(optional), .placeholder(...)(optional), .preview(...)(optional), .preview_config(...)(optional), .on_load(...)(optional), .on_error(...)(optional), .class(...)(optional), .style(...)(optional), .image_class(...)(optional), .image_style(...)(optional) to set the values of the fields.
Finally, call .build() to create the instance of ImageProps.
Trait Implementations§
Source§impl Clone for ImageProps
impl Clone for ImageProps
Source§fn clone(&self) -> ImageProps
fn clone(&self) -> ImageProps
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more