1. Reference
  2. Layout

<grid>

A two-dimensional grid with a set number of columns and even spacing.

Layout
grid.ham
<grid columns="3"
      spacing="8"
      run-spacing="8">
    <img src="https://hypeapps.dev/gallery/assets/landscape.jpg"
         style="aspect-1/1 rounded"
         fit="cover"/>
    <img src="https://hypeapps.dev/gallery/assets/city.jpg"
         style="aspect-1/1 rounded"
         fit="cover"/>
    <img src="https://hypeapps.dev/gallery/assets/dish.jpg"
         style="aspect-1/1 rounded"
         fit="cover"/>
    <img src="https://hypeapps.dev/gallery/assets/person1.jpg"
         style="aspect-1/1 rounded"
         fit="cover"/>
    <img src="https://hypeapps.dev/gallery/assets/person2.jpg"
         style="aspect-1/1 rounded"
         fit="cover"/>
    <img src="https://hypeapps.dev/gallery/assets/person3.jpg"
         style="aspect-1/1 rounded"
         fit="cover"/>
</grid>
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
aspect-ratio Child aspect ratio
number
1.0
columns Number of columns
number
2
run-spacing Vertical space between rows
number
0
spacing Horizontal space between items
number
0

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.