Marketing sectionsBentoMedia
Searchastronomic.dev# BentoMedia
To show several strengths at once in tiles of different sizes, each with a photo above, beside or behind its text.
Static: no JavaScript.
## Usage
```astro
import BentoMedia from "@astronomic/ui-pro/components/BentoMedia.astro";
```
## Examples
### Studio strengths with pictures
Seven tiles, each with a photo above its title and text. In the large, the tall and the wide tile the photo fills the free height, cropped to cover; in a normal tile it keeps 16/9, so the normal tiles set the row height. The photo sits above the text, the default mediaPlacement.
```astro
---
import BentoMedia from "@astronomic/ui-pro/components/BentoMedia.astro";
// Your own image files.
import concrete from "../../photos/concrete-slab.webp";
import binders from "../../photos/folder-stack.webp";
import notebook from "../../photos/leather-notebook.webp";
import plants from "../../photos/plants-shelf.webp";
import sketching from "../../photos/sketching-wireframes.webp";
import desk from "../../photos/studio-desk.webp";
import shelves from "../../photos/studio-shelves.webp";
const items = [
{
title: "Sites your team can run",
text: "Every page is built for your editors, so new work and news go live without waiting on us.",
size: "large" as const,
highlighted: true,
image: { src: desk, alt: "A laptop, a framed print and a cactus on a light wood desk." },
},
{ title: "Brand first", text: "We start from what makes your firm different, then design around it.", size: "tall" as const, image: { src: sketching, alt: "A hand sketching page layouts on paper beside a mug." } },
{ title: "Clear copy", text: "We write with you, in your clients' words.", image: { src: notebook, alt: "A leather notebook and a pen on pale gray paper." } },
{ title: "Calm process", text: "A short brief, a few workshops and a plan you can see.", image: { src: shelves, alt: "Plates and bowls on white shelves." } },
{ title: "Support after launch", text: "Small changes every month, and help when you need it.", size: "wide" as const, image: { src: plants, alt: "Two potted plants on a wooden shelf." } },
{ title: "Built to last", text: "Plain, well-made pages that stay fast for years.", image: { src: concrete, alt: "A concrete building against the sky." } },
{ title: "Everything handed over", text: "Your files, your accounts and notes on how it all fits together.", image: { src: binders, alt: "A stack of white binders." } },
];
---
<div class="mx-auto max-w-6xl px-6 py-16">
<BentoMedia heading="Why firms choose us" text="What Astronomic brings to every project." items={items} />
</div>
```
### Photos beside the text
mediaPlacement="start" and "end" put the photo beside the text once that tile is 28rem wide: here the large tile and the three wide ones are. The two normal tiles are narrower, so their photos stack, above the text for start and below it for end. On a phone every tile stacks.
```astro
---
import BentoMedia from "@astronomic/ui-pro/components/BentoMedia.astro";
// Your own image files.
import concrete from "../../photos/concrete-slab.webp";
import binders from "../../photos/folder-stack.webp";
import notebook from "../../photos/leather-notebook.webp";
import plants from "../../photos/plants-shelf.webp";
import sketching from "../../photos/sketching-wireframes.webp";
import shelves from "../../photos/studio-shelves.webp";
// A large tile and three wide ones, each 28rem or more wide, put the photo beside the text: start or end. The two
// normal tiles are narrower, so theirs stacks (start above the text, end below). Four columns: two full rows, then
// two normal tiles and a wide one. Two columns: every big tile is a full row, the normal ones share one.
const items = [
{ title: "Built like client sites", text: "Each theme starts from a real kind of business, then gets the pages, content and settings that business needs.", size: "large" as const, mediaPlacement: "start" as const, image: { src: sketching, alt: "A hand sketching wireframes beside a mug." } },
{ title: "Content you can edit", text: "Pages, posts and settings live in Markdown or EmDash, not in the code.", size: "wide" as const, mediaPlacement: "end" as const, image: { src: notebook, alt: "A tan leather notebook, a pen and a clip on pale gray paper." } },
{ title: "Presets change the look", text: "Swap fonts, colors and corners without touching a component.", size: "wide" as const, mediaPlacement: "start" as const, image: { src: shelves, alt: "Plates and bowls on white shelves." } },
{ title: "Fast pages", text: "Small static pages that load quickly on any phone.", mediaPlacement: "end" as const, image: { src: concrete, alt: "A concrete building against the sky." } },
{ title: "Accessible", text: "Keyboard-friendly and checked for contrast.", mediaPlacement: "start" as const, image: { src: plants, alt: "Two potted plants on a wooden shelf." } },
{ title: "Docs in the box", text: "Each theme comes with docs on setup and content.", size: "wide" as const, mediaPlacement: "end" as const, image: { src: binders, alt: "A stack of white binders." } },
];
---
<div class="mx-auto max-w-6xl px-6 py-16">
<BentoMedia heading="Inside every theme" items={items} />
</div>
```
### Text on the photo
Every tile has mediaPlacement="behind": the photo fills the tile and the text sits on a scrim that keeps it readable on any picture. Two tiles are links with a viewText cue, so the grid packs sparsely; the large, tall and two normal tiles fill it with no hole.
```astro
---
import BentoMedia from "@astronomic/ui-pro/components/BentoMedia.astro";
// Your own image files.
import kitchen from "../../photos/kitchen-marble-after.webp";
import house from "../../photos/home-modern-glass.webp";
import portrait from "../../photos/portrait-glasses.webp";
import stairway from "../../photos/white-stairway.webp";
// Every tile puts its text on the photo, on a scrim. Two are links, so the grid packs sparsely and keeps the source
// order: large, tall, then two normal tiles fill four columns (two rows) and two columns (three rows) with no hole.
const items = [
{ title: "Apogee", text: "A bold site with motion for design studios and creative agencies.", size: "large" as const, mediaPlacement: "behind" as const, href: "/themes/apogee", viewText: "See Apogee", image: { src: stairway, alt: "A white stairwell seen from above." } },
{ title: "Vega", text: "A real home search with a map, for small real estate agencies.", size: "tall" as const, mediaPlacement: "behind" as const, href: "/themes/vega", viewText: "See Vega", image: { src: house, alt: "A modern dark house with tall glass walls at dusk." } },
{ title: "Groundcrew", text: "Calls and quote requests for builders, landscapers, plumbers and cleaners.", mediaPlacement: "behind" as const, image: { src: kitchen, alt: "A large kitchen with a marble island and white cabinets." } },
{ title: "Vesper", text: "A free personal blog and portfolio in one.", mediaPlacement: "behind" as const, image: { src: portrait, alt: "A woman with short fair hair and glasses in a leather jacket." } },
];
---
<div class="mx-auto max-w-6xl px-6 py-16">
<BentoMedia heading="Themes for real businesses" items={items} />
</div>
```
## Props
### BentoMedia
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `heading` | `string` | None | The section heading, in the section role in display type. Without it there is no section and no header: a plain <div> holds only the tiles. |
| `emphasis` | `boolean` | `false` | Turn one *phrase* in the heading into <em>: exactly two asterisks around text with no space inside, as in "Built for *the long run*". Any other asterisks show as typed. Off by default, so the heading shows as typed. How the <em> looks is the theme's. |
| `mark` | `string` | None | A short mark after the heading, such as "(12)" or "©2026", in small muted type. It sits beside the heading, outside it, so the heading's name stays plain. Shown only with a heading. |
| `markLabel` | `string` | None | What the mark says to a screen reader, such as "12 projects": the mark is then hidden from screen readers and this is read in its place. Without it, the mark is read as written. |
| `text` | `string` | None | One or two sentences under the heading, in the lead role, muted. Shown only with a heading. |
| `headingTag` | `"h2" \| "h3" \| "h4"` | `"h2"` | The heading element. Tile titles sit one level under it. |
| `class` | `string` | None | More classes for the root (the <section>, or the <div> without a heading), merged with cn(), so yours win on conflicts. The root is a named size container (inline-size containment): in a shrink-to-fit parent (inline-flex, a float, fit-content) it collapses, so give it a width there. |
| `itemHeadingTag` | `"h2" \| "h3" \| "h4" \| "h5"` | `"h3"` | The tile title element when there is no heading. With a heading, titles sit one level under it. |
| `items` | `BentoMediaItem[]` | None | Required. The tiles, in source order: { title, text?, size?, highlighted?, tone?, icon?, href?, viewText?, image, mediaPlacement? } (BentoMediaItem, exported from BentoMedia.astro), where image is { src, alt, width?, height?, focalPoint?, loading? }: src a URL or an imported image, alt required. size is "normal" (one cell, the default), "wide" (two across), "tall" (two down) or "large" (two by two). Below 32rem of width the grid is one column. From 32rem it has two: wide and large tiles take the full row, a tall tile two rows. From 48rem it has four, and a large tile is two by two. Every row is at least --ui-bento-row tall (11rem by default). highlighted gives a tile the soft accent fill; mark one at most, the most important. tone="inverse" gives the inverse fill instead (not with highlighted). icon draws a decorative icon above the title. text is optional. href makes the whole tile one link, its name the title; viewText (only with href) adds a cue such as "Learn more" at its foot. With any href the grid packs sparse, so the focus order follows the visual order: order the tiles so they leave no hole. Contradictory fields stop the build, naming the tile. In a wide, tall or large tile the image fills the free height (focalPoint picks what stays in view); in a normal tile with the image above or stacked, it keeps 16/9. mediaPlacement is "above" (the default), "start" or "end" (beside the text once the tile is 28rem wide, stacked below that) or "behind" (the image fills the tile and the text sits on a scrim; not with tone or highlighted). Only these fields reach each tile. |
| Slot | Description |
| --- | --- |
| `eyebrow` | A short line above the heading, such as a Badge. Shown only with a heading. |
Any other attribute goes on the <section>, or on the <div> without a heading.
## Accessibility
- With a heading, renders a <section> named by it, so it is a region landmark. The heading id is unique on the page.
- Without a heading, renders a plain <div>. Put your own heading above it.
- The tiles sit in one list (<ul role="list">), so a screen reader says how many there are.
- Each tile title sits one level under the section heading (h2 gives h3). With no heading, it is an h3 unless you set itemHeadingTag (recipes). In a bare Bento, set each tile's headingTag yourself.
- bentoGrid packs tiles densely, so the visual order can differ from the source order. Screen readers and the keyboard follow the source: put the most important tile first.
- Dense packing is fine for static tiles, not for links: Tab would jump. A grid with any linked tile packs sparse (bentoGridSparse in lib/bento.ts; the recipes switch on their own), so the focus order follows the visual order. A sparse grid can leave a hole: order the tiles so they fit.
- A linked tile is one link named by its title, so put anything that matters in the title or the text. A media visual that only decorates takes aria-hidden="true"; one that informs (a stat, a quote, code) keeps text a screen reader can read. Keep headings out of the media slot.
- The highlighted tile is marked by its fill and its place, not by color alone: make it the first and the largest.
- Every image needs alt text; use alt="" only when the picture adds nothing to the title.
BentoMedia
ProTo show several strengths at once in tiles of different sizes, each with a photo above, beside or behind its text.
- File
- BentoMedia.astro
- Group
- Marketing sections
- Kind
- Static: no JavaScript
- Examples
- 3
Examples
Drag the orange handle to set the width. Frames get real breakpoints.
- Static
- Interactive
- Framed
Studio strengths with pictures
Seven tiles, each with a photo above its title and text. In the large, the tall and the wide tile the photo fills the free height, cropped to cover; in a normal tile it keeps 16/9, so the normal tiles set the row height. The photo sits above the text, the default mediaPlacement.
This preview did not load.
examples/bentomedia/main.astro
---
import BentoMedia from "@astronomic/ui-pro/components/BentoMedia.astro";
// Your own image files.
import concrete from "../../photos/concrete-slab.webp";
import binders from "../../photos/folder-stack.webp";
import notebook from "../../photos/leather-notebook.webp";
import plants from "../../photos/plants-shelf.webp";
import sketching from "../../photos/sketching-wireframes.webp";
import desk from "../../photos/studio-desk.webp";
import shelves from "../../photos/studio-shelves.webp";
const items = [
{
title: "Sites your team can run",
text: "Every page is built for your editors, so new work and news go live without waiting on us.",
size: "large" as const,
highlighted: true,
image: { src: desk, alt: "A laptop, a framed print and a cactus on a light wood desk." },
},
{ title: "Brand first", text: "We start from what makes your firm different, then design around it.", size: "tall" as const, image: { src: sketching, alt: "A hand sketching page layouts on paper beside a mug." } },
{ title: "Clear copy", text: "We write with you, in your clients' words.", image: { src: notebook, alt: "A leather notebook and a pen on pale gray paper." } },
{ title: "Calm process", text: "A short brief, a few workshops and a plan you can see.", image: { src: shelves, alt: "Plates and bowls on white shelves." } },
{ title: "Support after launch", text: "Small changes every month, and help when you need it.", size: "wide" as const, image: { src: plants, alt: "Two potted plants on a wooden shelf." } },
{ title: "Built to last", text: "Plain, well-made pages that stay fast for years.", image: { src: concrete, alt: "A concrete building against the sky." } },
{ title: "Everything handed over", text: "Your files, your accounts and notes on how it all fits together.", image: { src: binders, alt: "A stack of white binders." } },
];
---
<div class="mx-auto max-w-6xl px-6 py-16">
<BentoMedia heading="Why firms choose us" text="What Astronomic brings to every project." items={items} />
</div>Photos beside the text
mediaPlacement="start" and "end" put the photo beside the text once that tile is 28rem wide: here the large tile and the three wide ones are. The two normal tiles are narrower, so their photos stack, above the text for start and below it for end. On a phone every tile stacks.
This preview did not load.
examples/bentomedia/beside.astro
---
import BentoMedia from "@astronomic/ui-pro/components/BentoMedia.astro";
// Your own image files.
import concrete from "../../photos/concrete-slab.webp";
import binders from "../../photos/folder-stack.webp";
import notebook from "../../photos/leather-notebook.webp";
import plants from "../../photos/plants-shelf.webp";
import sketching from "../../photos/sketching-wireframes.webp";
import shelves from "../../photos/studio-shelves.webp";
// A large tile and three wide ones, each 28rem or more wide, put the photo beside the text: start or end. The two
// normal tiles are narrower, so theirs stacks (start above the text, end below). Four columns: two full rows, then
// two normal tiles and a wide one. Two columns: every big tile is a full row, the normal ones share one.
const items = [
{ title: "Built like client sites", text: "Each theme starts from a real kind of business, then gets the pages, content and settings that business needs.", size: "large" as const, mediaPlacement: "start" as const, image: { src: sketching, alt: "A hand sketching wireframes beside a mug." } },
{ title: "Content you can edit", text: "Pages, posts and settings live in Markdown or EmDash, not in the code.", size: "wide" as const, mediaPlacement: "end" as const, image: { src: notebook, alt: "A tan leather notebook, a pen and a clip on pale gray paper." } },
{ title: "Presets change the look", text: "Swap fonts, colors and corners without touching a component.", size: "wide" as const, mediaPlacement: "start" as const, image: { src: shelves, alt: "Plates and bowls on white shelves." } },
{ title: "Fast pages", text: "Small static pages that load quickly on any phone.", mediaPlacement: "end" as const, image: { src: concrete, alt: "A concrete building against the sky." } },
{ title: "Accessible", text: "Keyboard-friendly and checked for contrast.", mediaPlacement: "start" as const, image: { src: plants, alt: "Two potted plants on a wooden shelf." } },
{ title: "Docs in the box", text: "Each theme comes with docs on setup and content.", size: "wide" as const, mediaPlacement: "end" as const, image: { src: binders, alt: "A stack of white binders." } },
];
---
<div class="mx-auto max-w-6xl px-6 py-16">
<BentoMedia heading="Inside every theme" items={items} />
</div>Text on the photo
Every tile has mediaPlacement="behind": the photo fills the tile and the text sits on a scrim that keeps it readable on any picture. Two tiles are links with a viewText cue, so the grid packs sparsely; the large, tall and two normal tiles fill it with no hole.
This preview did not load.
examples/bentomedia/behind.astro
---
import BentoMedia from "@astronomic/ui-pro/components/BentoMedia.astro";
// Your own image files.
import kitchen from "../../photos/kitchen-marble-after.webp";
import house from "../../photos/home-modern-glass.webp";
import portrait from "../../photos/portrait-glasses.webp";
import stairway from "../../photos/white-stairway.webp";
// Every tile puts its text on the photo, on a scrim. Two are links, so the grid packs sparsely and keeps the source
// order: large, tall, then two normal tiles fill four columns (two rows) and two columns (three rows) with no hole.
const items = [
{ title: "Apogee", text: "A bold site with motion for design studios and creative agencies.", size: "large" as const, mediaPlacement: "behind" as const, href: "/themes/apogee", viewText: "See Apogee", image: { src: stairway, alt: "A white stairwell seen from above." } },
{ title: "Vega", text: "A real home search with a map, for small real estate agencies.", size: "tall" as const, mediaPlacement: "behind" as const, href: "/themes/vega", viewText: "See Vega", image: { src: house, alt: "A modern dark house with tall glass walls at dusk." } },
{ title: "Groundcrew", text: "Calls and quote requests for builders, landscapers, plumbers and cleaners.", mediaPlacement: "behind" as const, image: { src: kitchen, alt: "A large kitchen with a marble island and white cabinets." } },
{ title: "Vesper", text: "A free personal blog and portfolio in one.", mediaPlacement: "behind" as const, image: { src: portrait, alt: "A woman with short fair hair and glasses in a leather jacket." } },
];
---
<div class="mx-auto max-w-6xl px-6 py-16">
<BentoMedia heading="Themes for real businesses" items={items} />
</div>