use fission::prelude::*;
fission_component! {
pub ProfilePlaceholder<()> {
props {
avatar_size: f32,
name_width: f32,
line_height: f32,
}
}
view(profile, _state, cx) {
let spacing = &cx.view.env().theme.tokens.spacing;
} =>
Column(
gap: spacing.m,
children: [
Skeleton(
id: WidgetId::explicit("profile.avatar-loading"),
width: profile.avatar_size,
height: profile.avatar_size,
circle: true,
motion: SkeletonMotion::Default,
),
Skeleton(
id: WidgetId::explicit("profile.name-loading"),
width: profile.name_width,
height: profile.line_height,
motion: SkeletonMotion::Default,
),
],
)
}
Field | Type | Meaning | Notes / default behavior |
|---|---|---|---|
id | WidgetId | Stable identity used for animation state. | Required. Give each skeleton a unique id. |
width | Option<f32> | Placeholder width. | Defaults to 100.0. |
height | Option<f32> | Placeholder height. | Defaults to 20.0. |
circle | bool | Whether to render the placeholder as a fully rounded shape. | Defaults to false. Useful for avatar placeholders. |
motion | Option<SkeletonMotion> | Optional pulse or custom transition. | None is static; Default or Pulse opts into motion. |