CdsPagelives inside CdsMain — outside it renders nothing and warns about it in the console. The paddings around the whole content area are calculated by CdsLayout.
Variations
Paddings
The padding prop adds inner paddings to the page — the usual layout for content screens. Without it the content sticks to the edges: that is how tables and maps that need the full width are laid out.
Custom height
The style-fn prop replaces the minimum height calculation with your own. The function receives the total height of the header and the footer and the height of the layout area, and returns a style string. This is how a page can be fixed in height and give the scrolling to an inner list or table.
Scenarios
A full-screen empty state
The minimum height accounts for the header and the footer, so the centering works against the real height of the page — the placeholder ends up exactly in the middle instead of right under the header.
API
Props
| Name | Type | Default | Description |
|---|---|---|---|
padding | boolean | undefined | false | Adds paddings to the page. |
styleFn | ((offset: number, height: number) => string) | undefined | — | Function that computes the styles of the page. It receives the total offset (header + footer) and the height of the area, and returns a style string. |
Slots
| Name | Type | Description |
|---|---|---|
default | any | Content of the page. |