Layout
Header
The top bar of a page layout, for the brand, the main navigation and the account menu. It takes the header area of the grid that tk:main builds, so it spans the page above the main content (and beside the sidebar when the sidebar comes first).
A <header> at least 4rem tall, with horizontal padding and a light gray background (dark gray in dark mode). Its children are laid out in a row, vertically centered: here the brand at the start and the appearance menu pushed to the end.
Centered content #
The background spans the whole width, while the content is held in a centered row, as tk:container with that size. container alone (true) uses the container's default width.
Always in view #
The header stays in view while the page scrolls, over the content, with a bottom border and a shadow. subtle gives it a white background (near black in dark mode).
Variants #
variant sets the background: subtle, strong, inverse, accent, ghost, or a color name for a tinted bar. Outside the page grid the header is a plain block.
With Livewire state #
The header is rendered again on each update, so a badge in it can show component state. Add items from the page content.
Nothing to show
Customization #
Classes go to the <header>; with container, the container: prefix reaches the centered row.
Reference
tk:header
| Prop | Type | Default | Description |
|---|---|---|---|
sticky |
bool | false |
Keeps the header in view while the page scrolls. |
container |
bool | string | false |
Holds the content in a centered row: true for the default width, or a size (xs, sm, md, lg, xl, 2xl, 3xl, full). |
variant |
string | light gray | The background: subtle (white), strong, inverse, accent, ghost (transparent), none (no classes), or a color name for a tinted one (blue, green...). |
Slots
| Slot | Description |
|---|---|
| default | The header content, laid out in a row. |
Prefixes
| Prefix | Goes to |
|---|---|
container: |
The centered row, when container is set. |
Customization
Classes and attributes on the tag go to the <header>. With container, the content is inside a container <div>, reached with a prefix (listed in the Reference above).
Nothing to show
Accessibility
A native <header>; placed at the top level of the page, outside <main> and <article>, browsers expose it as the banner landmark.
Behavior notes
- A sticky header keeps the distance from the top at which it is rendered, measured again when the window or the page is resized. Placed first on the page, that is the top of the viewport.
- With
sticky, the element haswire:ignore.self, so a Livewire update keeps the position it computed. - The header takes its place from the grid set up by
tk:mainon their common parent. When atk:sidebarcomes right before it, the sidebar takes the full height and the header starts beside it.