yewlish-utils 0.1.12

Common utils for yewlish component set
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use yew::{html::IntoPropValue, AttrValue};

#[derive(Clone, Default, Debug, PartialEq)]
pub enum Orientation {
    #[default]
    Horizontal,
    Vertical,
}

impl IntoPropValue<Option<AttrValue>> for Orientation {
    fn into_prop_value(self) -> Option<AttrValue> {
        match self {
            Self::Horizontal => Some("horizontal".into()),
            Self::Vertical => Some("vertical".into()),
        }
    }
}