Layout
Main
The main content area of a page, and the piece that turns its parent into the page grid. With tk:main inside it, an element lays its children out in the header, sidebar, main, aside and footer areas, so tk:header, tk:sidebar, tk:aside and tk:footer find their places by themselves.
Dashboard
Nothing to show
The parent <div> becomes a grid: the header across the top, the main area filling the remaining height, the footer at the bottom. The <main> has padding (p-6, p-8 from lg).
Centered column #
The content is held in a centered column of that width, as tk:container sizes it. container alone (true) uses the container's default width.
Nothing to show
With header, aside and footer #
The header, aside and footer only need to be siblings of tk:main to find their places; the aside moves under the content below lg.
Release notes
Nothing to show
Livewire content #
The main area holds any Livewire content; here a search bound with wire:model.live filters the users listed under it.
Nothing to show
Customization #
Classes and attributes go to the <main>. Pass an id when there is more than one main area on screen; the default is main-content, the target of a skip link.
Settings
Nothing to show
Reference
tk:main
| Prop | Type | Default | Description |
|---|---|---|---|
container |
bool | string | false |
Centers the content in a column: true for the default width, or a size (xs, sm, md, lg, xl, 2xl, 3xl, full). |
id |
string | main-content |
The element id, the target of a "skip to content" link. |
Slots
| Slot | Description |
|---|---|
| default | The page content. |
Customization
Classes and attributes go to the <main> element.
Nothing to show
Inside a tk:container, the main area drops its own horizontal padding, so the container's applies.
Accessibility
A native <main>, the main landmark, with tabindex="-1" and the id main-content, so a skip link (<a href="#main-content">) can move the focus to it.
Behavior notes
- The grid is set on the direct parent of
tk:main: header, sidebar, aside and footer must be its siblings. - With the sidebar written right before the header, the sidebar takes the full height and the header sits beside it; otherwise the header spans the top, over the sidebar.
- Below the
lgbreakpoint the aside moves under the main content, and the footer under the aside. - Use one
tk:mainper page.