pub struct SkeletonProps {Show 27 fields
pub children: Element,
pub variant: Variant,
pub animation: Animation,
pub direction: Direction,
pub theme: Theme,
pub width: &'static str,
pub height: &'static str,
pub font_size: Option<&'static str>,
pub border_radius: &'static str,
pub display: &'static str,
pub line_height: &'static str,
pub position: &'static str,
pub overflow: &'static str,
pub margin: &'static str,
pub custom_style: &'static str,
pub infer_size: bool,
pub show: bool,
pub delay_ms: u32,
pub responsive: bool,
pub max_width: Option<&'static str>,
pub min_width: Option<&'static str>,
pub max_height: Option<&'static str>,
pub min_height: Option<&'static str>,
pub animate_on_hover: bool,
pub animate_on_focus: bool,
pub animate_on_active: bool,
pub animate_on_visible: bool,
}dio only.Expand description
Properties for the Skeleton component.
Fieldsยง
ยงchildren: ElementChild elements to render inside the skeleton.
If provided, the children will be wrapped with the skeleton styling and animation.
variant: VariantThe visual variant of the skeleton.
Variants control the shape or type of the skeleton placeholder, such as text or circle.
Defaults to Variant::Text.
animation: AnimationAnimation style applied to the skeleton.
Controls how the skeleton animates, e.g., pulse, wave, etc.
Defaults to Animation::Pulse.
direction: DirectionDirection of the animation direction and background color gradient.
theme: ThemeThe theme of the skeleton appearance.
Allows switching between light or dark themes.
Defaults to Theme::Light.
width: &'static strThe width of the skeleton.
Accepts any valid CSS width value (e.g., 100%, 200px, 10rem). Defaults to "100%".
height: &'static strThe height of the skeleton.
Accepts any valid CSS height value. Defaults to "1em".
font_size: Option<&'static str>Optional font size for the skeleton text.
Used to size the placeholder in proportion to text elements. If not set, font size is not applied.
border_radius: &'static strBorder radius for the skeleton.
Controls the rounding of the skeletonโs corners. Accepts any valid CSS radius.
Defaults to "4px".
display: &'static strDisplay property for the skeleton.
Determines the skeletonโs display type (e.g., inline-block, block). Defaults to "inline-block".
line_height: &'static strLine height of the skeleton content.
This affects vertical spacing in text-like skeletons. Defaults to "1".
position: &'static strThe CSS position property.
Controls how the skeleton is positioned. Defaults to "relative".
overflow: &'static strOverflow behavior of the skeleton container.
Accepts values like hidden, visible, etc. Defaults to "hidden".
margin: &'static strMargin applied to the skeleton.
Accepts any valid CSS margin value. Defaults to "".
custom_style: &'static strAdditional inline styles.
Allows you to append arbitrary CSS to the skeleton component. Useful for quick overrides.
infer_size: boolWhether to automatically infer the size from children.
If true, the skeleton will try to match the dimensions of its content.
show: boolWhether the skeleton is currently visible.
Controls whether the skeleton should be rendered or hidden.
delay_ms: u32Delay before the skeleton becomes visible, in milliseconds.
Useful for preventing flicker on fast-loading content. Defaults to 0.
responsive: boolWhether the skeleton is responsive.
Enables responsive resizing behavior based on the parent container or screen size.
max_width: Option<&'static str>Optional maximum width of the skeleton.
Accepts any valid CSS width value (e.g., 600px, 100%).
min_width: Option<&'static str>Optional minimum width of the skeleton.
Accepts any valid CSS width value.
max_height: Option<&'static str>Optional maximum height of the skeleton.
Accepts any valid CSS height value.
min_height: Option<&'static str>Optional minimum height of the skeleton.
Accepts any valid CSS height value.
animate_on_hover: boolWhether the skeleton animates on hover.
When enabled, an animation will be triggered when the user hovers over the skeleton.
animate_on_focus: boolWhether the skeleton animates on focus.
Useful for accessibility - triggers animation when the component receives focus.
animate_on_active: boolWhether the skeleton animates on active (click or tap).
Triggers animation when the skeleton is actively clicked or touched.
animate_on_visible: boolWhether the skeleton animates when it becomes visible in the viewport.
Uses IntersectionObserver to detect visibility and trigger animation.
Implementationsยง
Sourceยงimpl SkeletonProps
impl SkeletonProps
Sourcepub fn builder() -> SkeletonPropsBuilder<((), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), ())>
pub fn builder() -> SkeletonPropsBuilder<((), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), ())>
Create a builder for building SkeletonProps.
On the builder, call .children(...)(optional), .variant(...)(optional), .animation(...)(optional), .direction(...)(optional), .theme(...)(optional), .width(...)(optional), .height(...)(optional), .font_size(...)(optional), .border_radius(...)(optional), .display(...)(optional), .line_height(...)(optional), .position(...)(optional), .overflow(...)(optional), .margin(...)(optional), .custom_style(...)(optional), .infer_size(...)(optional), .show(...)(optional), .delay_ms(...)(optional), .responsive(...)(optional), .max_width(...)(optional), .min_width(...)(optional), .max_height(...)(optional), .min_height(...)(optional), .animate_on_hover(...)(optional), .animate_on_focus(...)(optional), .animate_on_active(...)(optional), .animate_on_visible(...)(optional) to set the values of the fields.
Finally, call .build() to create the instance of SkeletonProps.
Trait Implementationsยง
Sourceยงimpl Clone for SkeletonProps
impl Clone for SkeletonProps
Sourceยงfn clone(&self) -> SkeletonProps
fn clone(&self) -> SkeletonProps
1.0.0 ยท Sourceยงfn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSourceยงimpl PartialEq for SkeletonProps
impl PartialEq for SkeletonProps
Sourceยงimpl Properties for SkeletonPropswhere
Self: Clone,
impl Properties for SkeletonPropswhere
Self: Clone,
Sourceยงtype Builder = SkeletonPropsBuilder<((), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), ())>
type Builder = SkeletonPropsBuilder<((), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), ())>
Sourceยงfn memoize(&mut self, new: &Self) -> bool
fn memoize(&mut self, new: &Self) -> bool
Sourceยงfn into_vcomponent<M>(
self,
render_fn: impl ComponentFunction<Self, M>,
) -> VComponentwhere
M: 'static,
fn into_vcomponent<M>(
self,
render_fn: impl ComponentFunction<Self, M>,
) -> VComponentwhere
M: 'static,
impl StructuralPartialEq for SkeletonProps
Auto Trait Implementationsยง
impl !Freeze for SkeletonProps
impl !RefUnwindSafe for SkeletonProps
impl !Send for SkeletonProps
impl !Sync for SkeletonProps
impl Unpin for SkeletonProps
impl !UnwindSafe for SkeletonProps
Blanket Implementationsยง
Sourceยงimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Sourceยงfn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Sourceยงimpl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Sourceยงimpl<T> InitializeFromFunction<T> for T
impl<T> InitializeFromFunction<T> for T
Sourceยงfn initialize_from_function(f: fn() -> T) -> T
fn initialize_from_function(f: fn() -> T) -> T
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>
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
self to a value of a Properties struct.