1use dioxus::core::{AttributeValue, IntoAttributeValue};
2use dioxus::prelude::*;
3
4#[derive(Clone, PartialEq)]
6pub struct IconSize(AttributeValue);
7
8impl IconSize {
9 pub(crate) fn into_value(self) -> AttributeValue {
10 self.0
11 }
12}
13
14impl Default for IconSize {
15 fn default() -> Self {
16 Self(AttributeValue::Int(24))
17 }
18}
19
20impl<T> From<T> for IconSize
21where
22 T: IntoAttributeValue,
23{
24 fn from(value: T) -> Self {
25 Self(value.into_value())
26 }
27}
28
29#[derive(Clone, PartialEq, Props)]
31pub struct IconProps {
32 #[props(into, default = IconSize::default())]
34 pub size: IconSize,
35 #[props(extends = SvgAttributes)]
37 pub attributes: Vec<Attribute>,
38}