Loading State
loadingState configures the built-in loading UI for the content zone. Activate it by setting status: 'loading' on ContentConfig.
Three display patterns are available — spinner, skeleton, and text — plus a full custom renderer override.
How it works
Set status: 'loading' to activate. Widgemo renders the loading UI instead of data content. Set loadingState.enabled: false to suppress the built-in loading UI while keeping status: 'loading' (useful when you render loading UI outside Widgemo).
zones: {
content: {
status: 'loading',
loadingState: {
indicator: 'spinner', // 'spinner' | 'skeleton' | 'text'
message: 'Fetching data…', // string or (data) => string
},
mode: 'table',
item: { fields: […], layout: { type: 'auto' } },
},
},
Spinner (default)
Default spinner indicator with a custom message.
content: {
status: 'loading',
loadingState: { indicator: 'spinner', message: 'Fetching team data…' },
mode: 'table',
item: { … },
},
Skeleton — text bars
Skeleton with 'text-bars' variant and shimmer animation (default).
Skeleton — table cells
Skeleton with 'table-cells' variant — gives a mode-representative placeholder for table content.
Skeleton — cards grid
Skeleton with 'cards-grid' variant — representative placeholder for grid/card layouts.
Skeleton — pie chart
Skeleton with 'pie-chart' variant — representative placeholder for chart content.
Text indicator
'text' indicator — minimal; renders the message string in muted text only.
loadingState options
| Option | Type | Default | Effect |
|---|---|---|---|
enabled | boolean | true | Set to false to suppress built-in loading UI while keeping status: 'loading'. |
indicator | 'spinner' | 'skeleton' | 'text' | 'spinner' | Built-in loading indicator style. |
skeleton.variant | 'text-bars' | 'table-cells' | 'cards-grid' | 'pie-chart' | 'text-bars' | Skeleton layout shape. Choose the one that matches your content mode. |
skeleton.animation | 'shimmer' | 'morph' | 'none' | 'shimmer' | Skeleton animation style. |
skeleton.gifUrl | string | unset | Replace the built-in skeleton with a custom GIF. |
message | string | (data) => string | 'Loading...' | Text shown below the indicator. Accepts a function for dynamic messages. |
renderer | (props) => ReactNode | unset | Full custom loading UI. When provided, overrides all built-in indicator rendering. |
Custom renderer
When renderer is provided it takes full control of the loading UI — built-in indicator rendering is bypassed entirely.
renderer: (props: {
message?: string;
indicator?: 'spinner' | 'skeleton' | 'text';
skeleton?: { variant?, animation?, gifUrl? };
data?: Entity[];
}) => ReactNode
See Also
- Content Config —
status,loadingStatefields - Error State —
status: 'error'anderrorState - Widgemo Props —
loadingsugar prop