Feedback

Skeleton

A placeholder shimmer shown while content loads.

Rust
1use herogpui::components::skeleton::Skeleton;

Usage

Rust
1use herogpui::prelude::Skeleton;
2use gpui::prelude::*;
3use gpui::px;
4
5gpui::div()
6    .w(px(250.))
7    .flex()
8    .flex_col()
9    .gap(px(20.))
10    .child(Skeleton::new().w(px(218.)).h(px(128.)))
11    .child(
12        gpui::div()
13            .flex()
14            .flex_col()
15            .gap(px(12.))
16            .child(Skeleton::new().w(px(130.)).h(px(12.)))
17            .child(Skeleton::new().w(px(174.)).h(px(12.)))
18            .child(Skeleton::new().w(px(87.)).h(px(12.))),
19    )

Live HeroGPUI compiled to WebAssembly. Select any example without loading another WASM instance.

Anatomy

Rust types

Skeleton

Skeleton is assembled from these builders. The API reference lists each one.

Customization

Appearance builders and theme tokens Skeleton uses.

Styling

Skeleton styling
StyleDescription
surface_tertiary + hairline_radius + overflow_hiddenTheme secondary-surface placeholder clipped to the shared hairline radius.
SkeletonAnimation::Shimmer + 1400ms repeated animationA translucent background-colored band sweeps left to right.
SkeletonAnimation::Pulse + 1600ms repeated animationOpacity oscillates while motion is enabled.

API reference

Builders

Skeleton builders
BuilderTypeDefaultDescription
animation_type(SkeletonAnimation)SkeletonAnimationSkeletonAnimation::ThemeSelects shimmer, pulse, or no animation; theme token supplies the default.

Parts

Skeleton parts
PartDescription
SkeletonClipped placeholder surface with optional hidden layout content.

States

Skeleton states
BuilderStateDescription
SkeletonAnimation::ShimmerShimmerA highlight band sweeps across the placeholder.
SkeletonAnimation::PulsePulseThe placeholder opacity pulses.
SkeletonAnimation::None / reduce_motionNo animationA static placeholder is rendered, including when reduced motion is requested.