A skeleton is a temporary placeholder that previews the approximate shape of content while it loads. Use one when you know where the elements will appear.
The <kbq-skeleton> element is a basic rectangular block. Set its width and height with CSS. Combine several blocks into a custom composition when no preset fits.
Presets are ready-made placeholders for Koobiq components. Combine them to create a placeholder for an entire page.
KbqSkeletonTypography creates a placeholder with line heights that match the selected Koobiq typography style. When there are several lines, their widths alternate randomly. The uneven right edge makes the placeholder look more like a paragraph.
Placeholders for buttons, badges, tags, icons, and links match the height of their components. You can set their width with CSS.
KbqSkeletonGroup displays a row of placeholders of the same type: buttons, badges, tags, icons, or links.
The KbqSkeletonDl component displays a placeholder for a set of parameters and their values.
While a table or AG Grid is loading, KbqSkeletonTable imitates its structure. You can set:
KbqSkeletonFormField shows the label, field, and hint below it as one placeholder. The preset supports a multiline field and a label placed to its left.
KbqSkeletonAccordion displays a placeholder for the accordion component. The skeleton shows all groups collapsed.
KbqSkeletonCheckable displays simplified placeholders for the label and a checkbox, radio button, or toggle. You can also show a hint.
KbqSkeletonTabs creates a placeholder for tabs. You can customize the tab content. By default, it shows lines of text.
KbqSkeletonTree displays a placeholder for a hierarchical list. The second node is expanded to show the nested structure.
Use kbqSkeletonPresetsConfigurationProvider to configure presets for the entire application or individual pages.
import { kbqSkeletonPresetsConfigurationProvider } from '@koobiq/components/skeleton';
@Component({
providers: [
kbqSkeletonPresetsConfigurationProvider({
typographyLines: 1,
dlRows: 3,
tableRows: 3,
tableColumns: 3,
groupCount: 3,
accordionRows: 3,
checkableRows: 1,
tabsCount: 3,
tabsContentLines: 3,
treeRows: 3,
treeChildren: 3
})
]
})The kbqSkeleton directive turns rendered elements and their content into placeholders that preserve their size.
While the code block loads, a fixed-height skeleton appears in its place.
Data loads in parts. Placeholders disappear as the data updates.
Use a skeleton when:
Do not use a skeleton in these cases: