Enum patternfly_yew::Icon

source ·
pub enum Icon {
Show 33 variants AngleDown, AngleLeft, AngleDoubleLeft, AngleRight, AngleDoubleRight, AngleUp, ArrowDown, ArrowLeft, ArrowRight, ArrowUp, Bell, CaretDown, CaretUp, Check, CheckCircle, Copy, Cubes, EllipsisH, EllipsisV, ExclamationCircle, ExclamationTriangle, ExternalLinkAlt, InfoCircle, Minus, MinusCircleIcon, Pause, Play, PlusCircleIcon, QuestionCircle, Times, Th, Help, Pending,
}

Variants§

§

AngleDown

§

AngleLeft

§

AngleDoubleLeft

§

AngleRight

§

AngleDoubleRight

§

AngleUp

§

ArrowDown

§

ArrowLeft

§

ArrowRight

§

ArrowUp

§

Bell

§

CaretDown

§

CaretUp

§

Check

§

CheckCircle

§

Copy

§

Cubes

§

EllipsisH

§

EllipsisV

§

ExclamationCircle

§

ExclamationTriangle

§

ExternalLinkAlt

§

InfoCircle

§

Minus

§

MinusCircleIcon

§

Pause

§

Play

§

PlusCircleIcon

§

QuestionCircle

§

Times

§

Th

§

Help

§

Pending

Implementations§

Examples found in repository?
src/chip.rs (line 65)
61
62
63
64
65
66
67
68
69
70
71
    fn render_icon(&self, ctx: &Context<Self>) -> Html {
        if let Some(icon) = &ctx.props().icon {
            html! {
                <span class="pf-c-chip__icon">
                    { icon.as_html() }
                </span>
            }
        } else {
            html! {}
        }
    }
More examples
Hide additional examples
src/label.rs (line 107)
103
104
105
106
107
108
109
110
111
112
113
    fn render_icon(&self, ctx: &Context<Self>) -> Html {
        if let Some(icon) = &ctx.props().icon {
            html! {
                <span class="pf-c-label__icon">
                    { icon.as_html() }
                </span>
            }
        } else {
            html! {}
        }
    }
src/icon.rs (line 114)
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
    pub fn with_state_weight(&self, state: State, weight: usize) -> Html {
        let style = state
            .as_var(weight)
            .map(|v| format!("color: var({});", v))
            .unwrap_or_default();

        html! {
            <span style={style}>
                { self.as_html() }
            </span>
        }
    }

    pub fn with_classes(&self, mut classes: Classes) -> Html {
        self.extend(&mut classes);

        html! {
            <i class={classes} aria-hidden="true"></i>
        }
    }
}

fn fas(name: &str) -> [&str; 2] {
    ["fas", name]
}

fn pf(name: &str) -> [&str; 2] {
    ["pficon", name]
}

impl From<Icon> for VNode {
    fn from(icon: Icon) -> Self {
        icon.as_html()
    }
}

impl IntoPropValue<Html> for Icon {
    fn into_prop_value(self) -> Html {
        self.as_html()
    }
}

impl IntoPropValue<Option<Html>> for Icon {
    fn into_prop_value(self) -> Option<Html> {
        Some(self.as_html())
    }
Examples found in repository?
src/icon.rs (line 103)
102
103
104
    pub fn with_state(&self, state: State) -> Html {
        self.with_state_weight(state, 200)
    }
Examples found in repository?
src/icon.rs (line 99)
98
99
100
    pub fn as_html(&self) -> Html {
        self.with_classes(Classes::new())
    }
More examples
Hide additional examples
src/empty.rs (line 74)
72
73
74
75
76
77
    fn render_icon(&self, ctx: &Context<Self>) -> Html {
        match ctx.props().icon {
            Some(icon) => html! {icon.with_classes(Classes::from("pf-c-empty-state__icon"))},
            None => html! {},
        }
    }

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Converts to this type from the input type.
Convert self to a value of a Properties struct.
Convert self to a value of a Properties struct.
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
Compare self to key and return true if they are equal.

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Convert self to a value of a Properties struct.
Convert self to a value of a Properties struct.
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more