Layout
Aside
A secondary column next to the main content, for what complements the page without being part of it: a table of contents, related links, a summary. Use it as a sibling of tk:main; for the application's navigation column use tk:sidebar.
Nothing to show
The element that holds tk:main becomes a grid, and the aside takes the column to the right of the main content, under the header, 16rem wide with a border on the side facing the content. Below the lg breakpoint it moves under the main content, at full width, with the border on top.
Sticky #
The aside stays in view while the page scrolls. It is never taller than the space left in the viewport, so content that does not fit scrolls inside the aside. Below lg it is not sticky and grows with its content.
Nothing to show
Inside a layout #
tk:layout.sidebar renders a sticky tk:aside when its aside slot has content, and no aside at all when it is empty. Attributes prefixed with aside: go to it.
Nothing to show
Order summary #
The aside is rendered again with the rest of the component, so it can sum Livewire state. Add an item from the main content.
Cart
Mechanical keyboard
USB-C hub
Nothing to show
Outside the page grid #
When the aside is not a sibling of tk:main it renders in the normal flow, as a bordered box.
Nothing to show
Customization #
Classes and attributes go to the <aside>. A width class replaces the default w-64; below lg the aside is always full width.
Nothing to show
Reference
Aside
| Prop | Type | Default | Description |
|---|---|---|---|
sticky |
bool | false |
Keeps the aside in view while the page scrolls, from the lg breakpoint up, with its own scroll when the content is taller than the viewport. |
ariaLabel |
string | none | The accessible name of the landmark, translated. |
Slots
| Slot | Description |
|---|---|
| default | The content of the aside. |
Customization
Classes and attributes go to the <aside> element. The default width (w-64) gives way to any width class passed; below lg the aside is always as wide as the page.
Nothing to show
Accessibility
Renders an <aside> element, which is a complementary landmark. Give it an ariaLabel when the page has more than one, so they can be told apart. It adds no keyboard interaction of its own: the content is reached in the normal tab order, and focusing something out of sight in a sticky aside scrolls the aside to it.
Behavior notes
- The grid placement depends on the parent: the aside only goes to the side column when it is a direct child of the same element as
tk:main. Anywhere else it renders in the normal flow, as a bordered box. - A sticky aside sticks at the distance from the top it has when the page loads, which is the height of the header above it. With a header that is not sticky, that gap stays empty above the aside once the header scrolls away; pair it with
<tk:header sticky>to keep the space filled. - The sticky offset and the maximum height are recalculated when the window or the page content is resized.
- The position is set by the script as an inline style, and it survives Livewire updates.
- In a right-to-left page the border moves to the other side of the aside.