CSC Design System v4
VueFlavour Vue React Angular TypeScriptPrimaryCSC UI ColorsPrimarySecondaryAccentCustom ColorsRedOrangeGreenBluePurplePink
Guides Getting started Customization Data visualization Migration guide Componentsc-accordionc-alertc-autocompletec-badgec-breadcrumbc-buttonc-button-groupc-cardc-checkboxc-color-pickerc-csc-logoc-data-tablec-date-pickerc-dividerc-file-uploadc-iconc-icon-buttonc-linkc-listc-loaderc-login-buttonsc-login-cardc-mainc-menuc-messagec-modalc-navigation-buttonc-number-fieldc-otp-inputc-pagec-paginationc-popoverc-progress-barc-progress-circlec-radio-groupc-selectc-side-navigationc-sliderc-spinnerc-statusc-stepsc-switchc-tablec-tabsc-tagsc-text-fieldc-time-pickerc-toastsc-toolbarc-tooltipc-tree-select

<c-main>

The page shell of an application: it paints the page canvas and lays out the toolbar, the side navigation and the page in the dashboard layout. It is at least a viewport tall and grows with its content, so the document — not a component — is what scrolls.

Usage

Dashboard layout

Slot the layout components as direct children and c-main places them: c-toolbar spans the top, c-side-navigation takes the left column and c-page fills the rest. The toolbar pins itself to the top of the viewport; c-main pins the desktop side navigation beneath it and moves its pin to the top edge when the toolbar is static. The drawer is sized to the pinned height: a short menu fills the column, a long one scrolls inside the drawer, and the side navigation's bottom slot stays at the bottom edge of the viewport — also while a banner or a static toolbar is still above the drawer. The 3.x autoheight host class is ignored here, and the mobile drawer is not touched. The drawer never adds to the layout's height: a page that fits the viewport is exactly a viewport tall and does not scroll, with or without a banner, pinned or static toolbar.

Banner

A full-width message strip above the toolbar — a service notice, an environment warning — goes in the banner slot. Slot a c-alert or your own markup; c-main only places it. The banner scrolls away with the page and the toolbar pins in its place. This is a message strip, not the ARIA banner landmark.

Disabling the layout

disable-layout turns the grid into a plain column, still at least a viewport tall, for pages that arrange their own chrome. The banner slot renders first in the column.

Scrolling

The document scrolls, so browser scroll restoration, anchors, find-in-page and mobile browser chrome all behave natively, and a modal inside c-main stops the page behind it. c-page has no fixed height and no scrollbar of its own; its scroll-indicator tracks the document. Set html { scroll-behavior: smooth } for smooth anchor scrolling.

Customization

Structural styling via ::part(root), the shell box; the dashboard grid inside it is not a part. Anything that paints below the shell's bottom edge is clipped rather than lengthening the page. To show the layout inside a bounded box — a demo, a preview — give the part a height together with min-height: 0 and overflow-y: auto, and set --c-main-viewport-height to the same height so the pinned side navigation is sized to the box instead of the viewport; the toolbar and side navigation then pin inside that box.

Examples

Basic
Vue React Angular TypeScript
<template>
  <c-main class="demo-shell">
    <c-alert slot="banner" type="info">
      Scheduled maintenance on Saturday 06:00–08:00 EEST.
    </c-alert>

    <c-toolbar>
      <c-csc-logo />

      <span>My Service</span>
    </c-toolbar>

    <c-side-navigation>
      <c-side-navigation-title>My project</c-side-navigation-title>

      <c-side-navigation-item active>Dashboard</c-side-navigation-item>

      <c-side-navigation-item>Members</c-side-navigation-item>

      <c-side-navigation-item>Billing</c-side-navigation-item>

      <c-button slot="bottom" inverted>Sign out</c-button>
    </c-side-navigation>

    <c-page>
      <h2>Dashboard</h2>

      <p>
        The banner leaves first. Then the toolbar pins to the top edge and the
        side navigation pins beneath it, while the page keeps scrolling
        underneath.
      </p>

      <p>
        In an application the shell fills the whole viewport and the document
        itself scrolls; here the shell is boxed to 320px so the behaviour is
        visible.
      </p>

      <p>
        Long menus get their own scrollbar inside the pinned side navigation,
        and the footer slot of the page stays at the bottom of a short page.
      </p>

      <p>
        Nothing here is demo-specific apart from the shell height: the layout
        components are slotted as direct children and c-main places them.
      </p>

      <p>Scroll back up to bring the banner back.</p>
    </c-page>
  </c-main>
</template>

<style scoped>
/* Demo-only sizing: c-main normally fills the whole viewport and the document scrolls. */
.demo-shell::part(root) {
  height: 320px;
  min-height: 0;
  overflow-y: auto;
  --c-main-viewport-height: 320px;
}
</style>
Static toolbar
Vue React Angular TypeScript
<template>
  <c-main class="demo-shell">
    <c-toolbar static>
      <c-csc-logo />

      <span>My Service</span>
    </c-toolbar>

    <c-side-navigation>
      <c-side-navigation-title>My project</c-side-navigation-title>

      <c-side-navigation-item active>Dashboard</c-side-navigation-item>

      <c-side-navigation-item>Members</c-side-navigation-item>
    </c-side-navigation>

    <c-page>
      <h2>Dashboard</h2>

      <p>
        With static the toolbar is ordinary content: it scrolls away with the
        page instead of pinning to the top edge.
      </p>

      <p>
        c-main follows the toolbar. Once the bar has left, the side navigation
        pins to the top edge instead of one toolbar height down.
      </p>

      <p>
        In an application the shell fills the whole viewport and the document
        itself scrolls; here the shell is boxed to 320px so the behaviour is
        visible.
      </p>

      <p>Scroll back up to bring the toolbar back.</p>
    </c-page>
  </c-main>
</template>

<style scoped>
/* Demo-only sizing: c-main normally fills the whole viewport and the document scrolls. */
.demo-shell::part(root) {
  height: 320px;
  min-height: 0;
  overflow-y: auto;
  --c-main-viewport-height: 320px;
}
</style>

API reference

<c-main>

The page shell of an application: it paints the page canvas and lays out the toolbar, the side navigation and the page in the dashboard layout. It is at least a viewport tall and grows with its content, so the document — not a component — is what scrolls.

Properties

PropertyAttributeTypeDefaultDescription
disableLayoutdisable-layoutbooleanfalse Turns off the dashboard layout: the slotted components stack in a plain column, still at least a viewport tall.

Slots

SlotDescription
defaultThe layout components: `c-toolbar`, `c-side-navigation` and `c-page`
bannerA full-width message strip above the toolbar; it scrolls away with the page

CSS parts

Style from outside with c-main::part(name) — parts are the library's only styling customization API.

PartDescription
rootThe shell box: it paints the page canvas and is at least a viewport tall; the dashboard grid is laid out inside it

CSS custom properties

PropertyDescription
--c-main-viewport-heightHeight of the scroll viewport the layout pins against (default `100dvh`); a bounded shell with its own scrollbar sets it to its box height