Skeleton
A loading placeholder shaped like the content it stands in for.
fandry-skeleton
Example
Link to section ExampleCustom colors and parts
Link to section Custom colors and partsThe same component with a few --fd-* tokens set around it and its parts restyled. The code is under Parts below.
Props
Link to section Props| Prop | Type | Default | Description |
|---|---|---|---|
variant | 'text' | 'circle' | 'rect' | 'text' | Placeholder shape. |
Parts
Link to section PartsStyle the elements inside the component from your own CSS with ::part(). Every fandry component renders in native shadow DOM, so parts work on LWR and Salesforce alike. For colors, spacing, radius and type across many components, set the --fd-* tokens instead. The code for the "Custom colors and parts" example above:
| Part | Description |
|---|---|
base | The outermost element. |
<!-- template -->
<div class="brand row">
<fandry-skeleton variant="circle"></fandry-skeleton>
<div class="stack grow">
<fandry-skeleton variant="text"></fandry-skeleton>
<fandry-skeleton variant="rect"></fandry-skeleton>
</div>
</div>
/* css */
/* Scoped to this demo. Set the same --fd-* tokens on :root to theme
every fandry-* component on the site. */
.brand {
--fd-bg-muted: 160 40% 90%;
--fd-radius-md: 1rem;
--fd-radius-sm: 999px;
}
fandry-skeleton::part(base) {
background: linear-gradient(90deg, hsl(160 40% 90%), hsl(45 80% 92%));
}
Code
Link to section Code<fandry-skeleton variant="circle"></fandry-skeleton> <fandry-skeleton variant="text"></fandry-skeleton>