Struct SkeletonProps

Source
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,
}
Available on crate feature yew only.
Expand description

Properties for the Skeleton component.

Fields§

§children: Children

Child elements to render inside the skeleton.

If provided, the children will be wrapped with the skeleton styling and animation.

§variant: Variant

The 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: Animation

Animation style applied to the skeleton.

Controls how the skeleton animates, e.g., pulse, wave, etc. Defaults to Animation::Pulse.

§direction: Direction

Direction of the animation direction and background color gradient.

§theme: Theme

The theme of the skeleton appearance.

Allows switching between light or dark themes. Defaults to Theme::Light.

§width: &'static str

The width of the skeleton.

Accepts any valid CSS width value (e.g., 100%, 200px, 10rem). Defaults to "100%".

§height: &'static str

The 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 str

Border radius for the skeleton.

Controls the rounding of the skeleton’s corners. Accepts any valid CSS radius. Defaults to "4px".

§display: &'static str

Display property for the skeleton.

Determines the skeleton’s display type (e.g., inline-block, block). Defaults to "inline-block".

§line_height: &'static str

Line height of the skeleton content.

This affects vertical spacing in text-like skeletons. Defaults to "1".

§position: &'static str

The CSS position property.

Controls how the skeleton is positioned. Defaults to "relative".

§overflow: &'static str

Overflow behavior of the skeleton container.

Accepts values like hidden, visible, etc. Defaults to "hidden".

§margin: &'static str

Margin applied to the skeleton.

Accepts any valid CSS margin value. Defaults to "".

§custom_style: &'static str

Additional inline styles.

Allows you to append arbitrary CSS to the skeleton component. Useful for quick overrides.

§infer_size: bool

Whether to automatically infer the size from children.

If true, the skeleton will try to match the dimensions of its content.

§show: bool

Whether the skeleton is currently visible.

Controls whether the skeleton should be rendered or hidden.

§delay_ms: u32

Delay before the skeleton becomes visible, in milliseconds.

Useful for preventing flicker on fast-loading content. Defaults to 0.

§responsive: bool

Whether 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: bool

Whether the skeleton animates on hover.

When enabled, an animation will be triggered when the user hovers over the skeleton.

§animate_on_focus: bool

Whether the skeleton animates on focus.

Useful for accessibility - triggers animation when the component receives focus.

§animate_on_active: bool

Whether the skeleton animates on active (click or tap).

Triggers animation when the skeleton is actively clicked or touched.

§animate_on_visible: bool

Whether 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

Source§

fn clone(&self) -> SkeletonProps

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl PartialEq for SkeletonProps

Source§

fn eq(&self, other: &SkeletonProps) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Properties for SkeletonProps

Source§

type Builder = SkeletonPropsBuilder

Builder that will be used to construct properties
Source§

fn builder() -> Self::Builder

Entrypoint for building properties
Source§

impl StructuralPartialEq for SkeletonProps

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> InitializeFromFunction<T> for T

Source§

fn initialize_from_function(f: fn() -> T) -> T

Create an instance of this type from an initialization function
Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

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

fn in_current_span(self) -> Instrumented<Self>

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

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T> IntoPropValue<Option<T>> for T

Source§

fn into_prop_value(self) -> Option<T>

Convert self to a value of a Properties struct.
Source§

impl<T> IntoPropValue<T> for T

Source§

fn into_prop_value(self) -> T

Convert self to a value of a Properties struct.
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<Ret> SpawnIfAsync<(), Ret> for Ret

Source§

fn spawn(self) -> Ret

Spawn the value into the dioxus runtime if it is an async block
Source§

impl<T, O> SuperFrom<T> for O
where O: From<T>,

Source§

fn super_from(input: T) -> O

Convert from a type to another type.
Source§

impl<T, O, M> SuperInto<O, M> for T
where O: SuperFrom<T, M>,

Source§

fn super_into(self) -> O

Convert from a type to another type.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<Token, Builder, How> AllPropsFor<Builder, How> for Token
where Builder: Buildable<Token>, <Builder as Buildable<Token>>::WrappedToken: HasAllProps<<Builder as Buildable<Token>>::Output, How>,

Source§

impl<T> DependencyElement for T
where T: 'static + PartialEq + Clone,

Source§

impl<T> HasAllProps<(), T> for T