pub struct Skeleton { /* private fields */ }Expand description
Skeleton loading placeholder with a configurable theme.
§Example
fn app() -> impl IntoElement {
let loading = use_state(|| true);
Skeleton::new(*loading.read())
.width(Size::px(200.))
.height(Size::px(80.))
.animation(SkeletonAnimation::Shimmer)
.duration(Duration::from_millis(1200))
.child("Some content")
}Implementations§
Trait Implementations§
Source§impl ChildrenExt for Skeleton
impl ChildrenExt for Skeleton
Source§fn get_children(&mut self) -> &mut Vec<Element>
fn get_children(&mut self) -> &mut Vec<Element>
Returns a mutable reference to the internal children vector. Read more
Source§fn children(self, children: impl IntoIterator<Item = impl IntoElement>) -> Self
fn children(self, children: impl IntoIterator<Item = impl IntoElement>) -> Self
Extends the children with an iterable of anything that implements
IntoElement. Read moreSource§fn maybe_child<C>(self, child: Option<C>) -> Selfwhere
C: IntoElement,
fn maybe_child<C>(self, child: Option<C>) -> Selfwhere
C: IntoElement,
Source§fn child<C>(self, child: C) -> Selfwhere
C: IntoElement,
fn child<C>(self, child: C) -> Selfwhere
C: IntoElement,
Appends a single child element. Read more
Source§impl Component for Skeleton
impl Component for Skeleton
fn render(&self) -> impl IntoElement
fn render_key(&self) -> DiffKey
Source§impl ContainerExt for Skeleton
impl ContainerExt for Skeleton
Source§impl ContainerWithContentExt for Skeleton
impl ContainerWithContentExt for Skeleton
Source§fn direction(self, direction: Direction) -> Self
fn direction(self, direction: Direction) -> Self
Set the axis children are stacked along. See
Direction.Source§fn main_align(self, main_align: impl Into<Alignment>) -> Self
fn main_align(self, main_align: impl Into<Alignment>) -> Self
Set how children are aligned along the direction axis. See
Alignment.Source§fn cross_align(self, cross_align: impl Into<Alignment>) -> Self
fn cross_align(self, cross_align: impl Into<Alignment>) -> Self
Set how children are aligned across the direction axis. See
Alignment.Source§fn spacing(self, spacing: f32) -> Self
fn spacing(self, spacing: f32) -> Self
Set the gap inserted between adjacent children, in pixels.
Source§fn content(self, content: Content) -> Self
fn content(self, content: Content) -> Self
Set how children share the available space along the direction axis. See
Content.Source§fn offset_x(self, offset_x: f32) -> Self
fn offset_x(self, offset_x: f32) -> Self
Shift the element’s children horizontally by the given pixels.
Source§fn offset_y(self, offset_y: f32) -> Self
fn offset_y(self, offset_y: f32) -> Self
Shift the element’s children vertically by the given pixels.
Source§fn vertical(self) -> Self
fn vertical(self) -> Self
Stack children vertically. Shorthand for
direction set to Direction::Vertical.Source§fn horizontal(self) -> Self
fn horizontal(self) -> Self
Stack children horizontally. Shorthand for
direction set to Direction::Horizontal.Source§impl KeyExt for Skeleton
impl KeyExt for Skeleton
Source§impl LayoutExt for Skeleton
impl LayoutExt for Skeleton
Source§fn get_layout(&mut self) -> &mut LayoutData
fn get_layout(&mut self) -> &mut LayoutData
Returns a mutable reference to the element’s layout data.
Source§fn layout(self, layout: LayoutData) -> Self
fn layout(self, layout: LayoutData) -> Self
Replace all of the element’s layout data at once. See
LayoutData.Source§impl SkeletonThemePartialExt for Skeleton
impl SkeletonThemePartialExt for Skeleton
fn background(self, background: impl Into<Color>) -> Self
fn shimmer_color(self, shimmer_color: impl Into<Color>) -> Self
fn duration(self, duration: impl Into<Duration>) -> Self
fn animation(self, animation: impl Into<SkeletonAnimation>) -> Self
fn corner_radius(self, corner_radius: impl Into<CornerRadius>) -> Self
fn shimmer_from(self, shimmer_from: f32) -> Self
fn shimmer_to(self, shimmer_to: f32) -> Self
fn shimmer_width(self, shimmer_width: f32) -> Self
impl StructuralPartialEq for Skeleton
Auto Trait Implementations§
impl !RefUnwindSafe for Skeleton
impl !Send for Skeleton
impl !Sync for Skeleton
impl !UnwindSafe for Skeleton
impl Freeze for Skeleton
impl Unpin for Skeleton
impl UnsafeUnpin for Skeleton
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
Mutably borrows from an owned value. Read more
Source§impl<T> ComponentKey for Twhere
T: Component,
impl<T> ComponentKey for Twhere
T: Component,
fn default_key(&self) -> DiffKey
Source§impl<T> ComponentProps for T
impl<T> ComponentProps for T
fn changed(&self, other: &(dyn ComponentProps + 'static)) -> bool
Source§impl<T> ContainerConstraintsExt for Twhere
T: ContainerExt,
impl<T> ContainerConstraintsExt for Twhere
T: ContainerExt,
Source§fn min_width(self, minimum_width: impl Into<Size>) -> Self
fn min_width(self, minimum_width: impl Into<Size>) -> Self
Set the minimum width the element can shrink to. See
Size.Source§fn min_height(self, minimum_height: impl Into<Size>) -> Self
fn min_height(self, minimum_height: impl Into<Size>) -> Self
Set the minimum height the element can shrink to. See
Size.Source§fn max_width(self, maximum_width: impl Into<Size>) -> Self
fn max_width(self, maximum_width: impl Into<Size>) -> Self
Set the maximum width the element can grow to. See
Size.Source§fn max_height(self, maximum_height: impl Into<Size>) -> Self
fn max_height(self, maximum_height: impl Into<Size>) -> Self
Set the maximum height the element can grow to. See
Size.Source§fn visible_width(self, visible_width: impl Into<VisibleSize>) -> Self
fn visible_width(self, visible_width: impl Into<VisibleSize>) -> Self
Set how much of the measured width is actually used in layout. See
VisibleSize.Source§fn visible_height(self, visible_height: impl Into<VisibleSize>) -> Self
fn visible_height(self, visible_height: impl Into<VisibleSize>) -> Self
Set how much of the measured height is actually used in layout. See
VisibleSize.Source§impl<T> ContainerPositionExt for Twhere
T: ContainerExt,
impl<T> ContainerPositionExt for Twhere
T: ContainerExt,
Source§impl<T> ContainerSizeExt for Twhere
T: ContainerExt,
impl<T> ContainerSizeExt for Twhere
T: ContainerExt,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more