Data displayBentoTile

Open in Create
Search
astronomic.dev

BentoTile

Pro

For one tile in a Bento section: its size, an icon, title and text, a dark or accent fill, a photo above, beside or behind the text, any visual you add, and a link or button. The bento recipes use it for you.

File
BentoTile.astro
Group
Data display
Kind
Static: no JavaScript
Examples
7
import BentoTile from "@astronomic/ui-pro/components/BentoTile.astro";

Examples

Drag the orange handle to set the width. Frames get real breakpoints.

  • Static
  • Interactive
  • Framed

In a Bento grid

Seven tiles that fill a four-column Bento grid with no gaps: a large highlighted tile, a tall one with an image that fills its free height, normal ones with and without text, and a wide one. The bento recipes build their tiles from it, so you only need it for your own layout.

main.astro

With an icon

Four tiles, each with a Lucide icon above the title: in the accent color on the surface and highlighted tiles, in the inverse mark color on the inverse one. The icon is decorative; the title says what it means.

icon.astro

Three tiles with href and a viewText cue ("Read the docs", "See the themes", "Get the pass"): a click anywhere on the tile follows the link, and the tile is one tab stop named by its title. The fourth is not a link and holds a Button in its action slot. The grid is not dense, so the tab order stays in the visual order.

Text on a photo

mediaPlacement="behind": the photo fills the tile and the text sits at its foot on a scrim that reads on any image. The large tile is one link with a viewText cue; the tall one has a Button with tone="image" in its action slot, on the same scrim.

behind.astro

Inverse and highlighted

The three fills side by side: the surface, highlighted (the soft accent fill) and tone="inverse" (dark on a light page, light on a dark page). The inverse tile holds a Button with tone="inverse" in its action slot.

tone.astro

Image beside the text

mediaPlacement="start" and "end": the image goes beside the text once the tile is 28rem wide, two parts to the text's three. The large tile puts it at the end, the wide one at the start. The tall tile is one cell wide, so its start image stacks above the text; narrower, every tile stacks, and end puts the image under the text.

beside.astro

Your own visual

The media slot holds any visual: a stat, a type-scale chart, a row of theme names, a quote, a code snippet and preset swatches. It has no inset, so text and numbers keep the card padding. Keep headings out of it: a stat is a <p>, a quote a <figure>; mark a picture that only decorates aria-hidden.

visual.astro
Minimal · Light

Waitlist

Be first in line

Join the waitlist and we'll email you the moment it's out.

You'll also get our newsletter: new themes, plugins and guides. Unsubscribe any time.