1. Reference
  2. Layout

<card>

A surface for grouped content, with padding, rounded corners and a soft shadow.

Layout
card.ham
<card style="w-full">
    <img src="https://hypeapps.dev/gallery/assets/dish.jpg"
         style="w-full h-160 rounded-lg"
         fit="cover"/>
    <text style="font-bold mt-12">Lemon ricotta pasta</text>
    <text style="muted">20 minutes · serves 2</text>
</card>
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
color Background color (auto-contrasts text); a bg-* in style= wins.
color
elevation Shadow depth as a number, mapped to shadow-*; a shadow-* in style= wins.
number
radius Corner radius in px; a rounded-* in style= wins.
number
variant Card style variant
elevated, filled, outlined
elevated

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.