Skip to content
Layout Main

Main

The main landmark, tall enough to keep the footer at the bottom of the screen.

On this page

Examples

A page has one main landmark: use As="div" when the layout already has one.

In a layout, KlyMain grows to fill the screen below the header, so the footer never floats up on a short page.

Copyright 2026 Acme Inc.

Razor
@* The site's own layout already has a main element, and a page has only one: As="div" here.
   Class="min-h-48" replaces the viewport-high minimum so the frame stays small. *@
<div class="w-full overflow-hidden rounded-xl border border-(--klyroo-border)">
    <KlyHeader Title="Acme" Sticky="false" />
    <KlyMain As="KlyElement.Div" Class="min-h-48 p-6" data-testid="main">
        <p class="text-sm text-(--klyroo-text-muted)">
            In a layout, KlyMain grows to fill the screen below the header, so the footer never floats up on a short page.
        </p>
    </KlyMain>
    <KlyFooter>
        <Left><p>Copyright 2026 Acme Inc.</p></Left>
    </KlyFooter>
</div>

API

KlyMain

The main landmark of a page. Its minimum height is the viewport minus the header ( --klyroo-header-height , 4rem by default), so a short page still pushes the footer to the bottom of the screen.

Parameters

Name Type Default Description
As KlyElement KlyElement.Main The element to render, Main by default. A page has only one main landmark: use Div when the layout already has one. Values: Div, Section, Article, Aside, Header, Footer, Main, Nav.
Class string Classes added to the root element, merged last so they win over the theme.
Ui MainUi Per-instance class overrides of the slots of the main area, see MainUi .

Slots

Name Type Description
ChildContent RenderFragment Content of the main area.

Ui slots

Ui takes a MainUi with one class string per slot, merged after the theme.

Slot Styles
Base Classes merged into the base slot of KlyMain , after the theme and the app configuration.