Enum patternfly_yew::Variant
source · pub enum Variant {
None,
Primary,
Secondary,
Tertiary,
Warning,
Danger,
DangerSecondary,
Link,
InlineLink,
Control,
Plain,
}Variants§
Implementations§
source§impl Variant
impl Variant
sourcepub fn as_classes(&self) -> Vec<&'static str> ⓘ
pub fn as_classes(&self) -> Vec<&'static str> ⓘ
Examples found in repository?
src/button.rs (line 172)
168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209
fn view(&self, ctx: &Context<Self>) -> Html {
let mut classes: Classes = classes!(
"pf-c-button",
ctx.props().class.clone(),
ctx.props().variant.as_classes()
);
if ctx.props().expanded {
classes.push("pf-m-expanded");
}
if ctx.props().block {
classes.push("pf-m-block");
}
if ctx.props().loading {
classes.push("pf-m-progress pf-m-in-progress")
}
return html! {
<button
ref={self.node_ref.clone()}
id={ctx.props().id.clone()}
class={classes}
style={ctx.props().style.clone()}
disabled={ctx.props().disabled}
type={ctx.props().r#type.clone()}
onclick={ctx.link().callback(Msg::Clicked)}
role={ctx.props().role.clone()}
form={ctx.props().form.clone()}
formaction={ctx.props().formaction.clone()}
>
if ctx.props().loading {
<span class="pf-c-button__progress">
<Spinner size={SpinnerSize::Md} />
</span>
}
{ self.label(ctx) }
{ for ctx.props().children.iter() }
</button>
};
}Trait Implementations§
impl Copy for Variant
impl Eq for Variant
impl StructuralEq for Variant
impl StructuralPartialEq for Variant
Auto Trait Implementations§
impl RefUnwindSafe for Variant
impl Send for Variant
impl Sync for Variant
impl Unpin for Variant
impl UnwindSafe for Variant
Blanket Implementations§
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoPropValue<Option<T>> for T
impl<T> IntoPropValue<Option<T>> for T
source§fn into_prop_value(self) -> Option<T>
fn into_prop_value(self) -> Option<T>
Convert
self to a value of a Properties struct.source§impl<T> IntoPropValue<T> for T
impl<T> IntoPropValue<T> for T
source§fn into_prop_value(self) -> T
fn into_prop_value(self) -> T
Convert
self to a value of a Properties struct.