Layout
Container
A centered block with a maximum width and horizontal padding, for keeping page content in a readable column. Use it around the content of a page or a section; the header, footer and main areas of a layout take the same box through their own container prop.
Nothing to show
The content sits in a column up to max-w-7xl (1280px) wide, centered with automatic side margins, with px-4 of padding on each side that grows to px-6 from the lg breakpoint. On narrower screens it takes the full width.
A narrower column #
size="md" caps the width at max-w-4xl (896px), which suits a form or an article. full removes the cap and keeps only the padding.
Nothing to show
Rendering from data #
Each section gets its own width. The container holds no state, so a Livewire update renders it again from the props.
Invoices
Reports
Nothing to show
Optional container #
tk:container.wrapper renders a tk:container around its content only when container is set, and passes its attributes to it. With $boxed set to 'md' the content gets the md container with py-4; with false, null or '' the content renders alone, with no element around it. It is what tk:header and tk:footer use for their container prop.
Content
Nothing to show
Sizes #
size caps the width, from xs (max-w-xl) to 3xl; full keeps only the padding. Wider sizes look the same here because the preview is narrower than them.
Nothing to show
Width and padding classes #
A max-w-* class wins over the width from size, and padding classes replace the default ones of the same breakpoint, so pass both px-* and lg:px-*.
Nothing to show
Around the main area #
A tk:main inside a container drops its own horizontal padding, so the two do not add up.
Account
Nothing to show
Reference
tk:container
tk:container.wrapper
tk:container
| Prop | Type | Default | Description |
|---|---|---|---|
size |
string | 2xl width |
The maximum width: xs (max-w-xl), sm (max-w-2xl), md (max-w-4xl), lg (max-w-5xl), xl (max-w-6xl), 2xl (max-w-7xl), 3xl (max-w-[96rem]) or full (no maximum). Any other value gives max-w-7xl. |
Slots
| Slot | Description |
|---|---|
| default | The content of the column. |
tk:container.wrapper
| Prop | Type | Default | Description |
|---|---|---|---|
container |
bool | string | null |
true wraps the content in a container of the default width; a string wraps it in a container of that size. Left out or false, the content renders without a container. |
Slots
| Slot | Description |
|---|---|
| default | The content, wrapped or not. |
Customization
Classes and attributes go to the container's <div>. On tk:container.wrapper they go to the container it renders.
Nothing to show
A max-w-* class wins over the width from size, so here the column is max-w-md. The padding classes replace the default ones.
Behavior notes
- The width from
sizeis applied with no specificity (:where()), so anymax-w-*class on the tag wins over it, whatever the order of the classes. - The default padding is
px-4pluslg:px-6. A class replaces only the one of the same breakpoint:class="px-8"still haspx-6fromlgup, so pass both (px-8 lg:px-8) to change it at every width. - A
tk:maininside a container drops its own horizontal padding, so the two do not add up. - The container has
data-tallkit-container, which is whattk:mainlooks for. - On
tk:container.wrapper,container="0"counts as off, and when there is no container the attributes given to the wrapper are dropped along with it.
Related
container prop puts the content in a container inside the full-width bar, so the background spans the page while the content keeps the column width.
Footer
their container prop puts the content in a container inside the full-width bar, so the background spans the page while the content keeps the column width.
Main
its container prop applies the same maximum width to the main area itself.