1. Reference
  2. Layout

<container>

The general-purpose container: groups children and gives them padding, color, corners and a border.

Layout

This tag has more than one name. Every spelling is the same tag, so write whichever feels natural. Pick one and every example on this page uses it.

container.ham
<container style="p-16 rounded-lg bg-gray-100 dark:bg-gray-800 border border-gray-200 dark:border-gray-700">
    <p style="font-bold">Morning run</p>
    <p style="muted">5.2 km in 28 minutes</p>
</container>
The snippet drawn by Hype Apps on a phone, in light mode The snippet drawn by Hype Apps on a phone, in dark mode
This snippet as Hype Apps draws it on a phone. It follows this page's light or dark theme.

Attributes

NameWhat it doesDefault
autoscroll-delay Autoscroll delay in seconds
number
0.0
autoscroll-loop Whether autoscroll loops
boolean
false
autoscroll-restart Autoscroll restart delay in seconds, or 'false' to disable
string
autoscroll-speed Autoscroll speed in pixels per second
number
autoscroll-target page: scroll the screen; self: scroll inside this box (give it a height). parent is accepted as self.
page, self
page
style Style classes (inline, flow, stretch, items-*)
string

Any tag also takes gestures: @on.tap, @on.longpress, @on.doubletap and @on.swipeleft (and right, up and down). @click runs on a tap too.

Guides and recipes that use it

This page is also Markdown, and all of HAM is in llms.txt.