Enum patternfly_yew::SpinnerSize
source · pub enum SpinnerSize {
None,
Sm,
Md,
Lg,
Xl,
Custom(String),
}Variants§
Implementations§
source§impl SpinnerSize
impl SpinnerSize
sourcepub fn as_classes(&self) -> Vec<&'static str> ⓘ
pub fn as_classes(&self) -> Vec<&'static str> ⓘ
Examples found in repository?
src/spinner.rs (line 52)
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71
fn view(&self, ctx: &Context<Self>) -> Html {
let mut classes = Classes::from("pf-c-spinner");
classes.extend(ctx.props().size.as_classes());
let style = if let SpinnerSize::Custom(diameter) = &ctx.props().size {
format!("--pf-c-spinner--diameter: {};", diameter)
} else {
String::new()
};
html! {
<svg
class={classes}
role="progressbar"
viewBox="0 0 100 100"
aria-label={ ctx.props().aria_label.clone() }
{ style }
>
<circle class="pf-c-spinner__path" cx="50" cy="50" r="45" fill="none" />
</svg>
}
}Trait Implementations§
source§impl Default for SpinnerSize
impl Default for SpinnerSize
source§impl PartialEq<SpinnerSize> for SpinnerSize
impl PartialEq<SpinnerSize> for SpinnerSize
source§fn eq(&self, other: &SpinnerSize) -> bool
fn eq(&self, other: &SpinnerSize) -> bool
impl StructuralPartialEq for SpinnerSize
Auto Trait Implementations§
impl RefUnwindSafe for SpinnerSize
impl Send for SpinnerSize
impl Sync for SpinnerSize
impl Unpin for SpinnerSize
impl UnwindSafe for SpinnerSize
Blanket Implementations§
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.