pub struct IconProps<T: IconShape> {
pub icon: T,
pub title: Option<&'static str>,
pub class: Option<&'static str>,
pub style: Option<&'static str>,
pub width: Option<u32>,
pub height: Option<u32>,
pub fill: Option<&'static str>,
pub stroke: Option<&'static str>,
pub view_box: Option<&'static str>,
pub xmlns: Option<&'static str>,
}Expand description
Props for the Icon component.
All fields are optional except icon. When a field is not provided,
the default value from the associated IconShape implementation is used.
Fields§
§icon: TThe icon shape implementation that provides SVG child elements.
title: Option<&'static str>Optional title text rendered as a <title> element inside the SVG for accessibility.
class: Option<&'static str>Optional CSS class name(s) applied to the <svg> element.
style: Option<&'static str>Optional inline CSS styles applied to the <svg> element.
width: Option<u32>Optional width of the SVG element in pixels.
Falls back to T::WIDTH if not set.
height: Option<u32>Optional height of the SVG element in pixels.
Falls back to T::HEIGHT if not set.
fill: Option<&'static str>Optional fill color for the SVG element.
Falls back to T::FILL, then to "currentColor" if not set.
stroke: Option<&'static str>Optional stroke color for the SVG element.
Falls back to T::STROKE if not set.
view_box: Option<&'static str>Optional view box attribute (e.g., "0 0 24 24").
Falls back to T::VIEW_BOX, then to "0 0 16 16" if not set.
xmlns: Option<&'static str>Optional XML namespace override.
Defaults to "http://www.w3.org/2000/svg" if not set.
Implementations§
Source§impl<T: IconShape> IconProps<T>
impl<T: IconShape> IconProps<T>
Sourcepub fn builder() -> IconPropsBuilder<((), (), (), (), (), (), (), (), (), ()), T>
pub fn builder() -> IconPropsBuilder<((), (), (), (), (), (), (), (), (), ()), T>
Create a builder for building IconProps.
On the builder, call .icon(...), .title(...)(optional), .class(...)(optional), .style(...)(optional), .width(...)(optional), .height(...)(optional), .fill(...)(optional), .stroke(...)(optional), .view_box(...)(optional), .xmlns(...)(optional) to set the values of the fields.
Finally, call .build() to create the instance of IconProps.