1. Reference
  2. Layout

<center>

Centers its children and their lines of text, on both axes or only one.

Layout
center.ham
<block style="w-full h-200 rounded-xl bg-gray-100 dark:bg-gray-800">
    <center>
        <icon name="check_circle teal size-48"/>
        <text style="font-bold mt-8">Payment received</text>
    </center>
</block>
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
horizontal true centers the horizontal axis (same presence rule as vertical).
boolean
vertical true centers the vertical axis. Once vertical or horizontal is present, the other axis defaults to off.
boolean

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.

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