pub struct SkeletonProps {Show 27 fields
pub children: Children,
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,
}yew only.Expand description
Properties for the Skeleton component.
Fields§
§children: ChildrenChild 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.
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 SkeletonProps
impl Properties for SkeletonProps
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.