This feature is experimental. Please share your experiences so we know what to keep or change.
Shows a temporary placeholder within an element.
The element's existing children will be hidden for the duration of this preview. When the preview ends, the placeholder will be removed and the element's original children are shown again.
If the previewed render pass opens a new overlay, the placeholder will be shown temporary overlay with the same visual style and open animation.
This preview shows a .skeleton element within the targeted fragment:
up.preview('skeleton', function(preview) {
preview.showPlaceholder('<span class=".skeleton">...</span>')
})
You may also clone a template:
up.preview('skeleton', function(preview) {
preview.showPlaceholder('#skeleton-template')
})
To show the placeholder within another element, pass it as a first reference argument:
up.preview('showPlaceholder', function(preview) {
preview.swapContent('body', '#skeleton-template')
})