Skeleton
Reserves space for content while it loads.
When to use
- Show where a region will appear while its data is being fetched.
Examples
Loading text rows
Loading the example
<k:Skeleton kind="text" count="3" loading="true"/>Load a shipment summary
The reload simulates a short request. The summary reappears when loading ends.
Loading the example
<k:Stack gap="10">
<k:Button text="Reload summary" enabled="{= !${/loading} }" press=".onReload"/>
<k:Skeleton kind="rows" count="2" loading="{/loading}">
<k:Text kind="heading" text="Shipment SH-104"/>
<k:Status state="success" text="Ready to ship"/>
</k:Skeleton>
</k:Stack>sap.ui.define(["sap/ui/core/mvc/Controller"], (Controller) => Controller.extend("sample.LoadShipment", {
onReload() {
const model = this.getView().getModel();
model.setProperty("/loading", true);
this.timer = setTimeout(() => model.setProperty("/loading", false), 900);
},
onExit() {
clearTimeout(this.timer);
}
}));API
Properties
| Name | Type | Default | Description |
|---|---|---|---|
loading | boolean | true | Whether loading placeholders are shown |
kind | string | text | text, rows, cards or chart |
count | int | 3 | Number of placeholders |
Aggregations
| Name | Type | Description |
|---|---|---|
content | sap.ui.core.Control[] | Content shown after loading |