Marketing sectionsBento

Open in Create
Search
astronomic.dev

Bento

Pro

To build your own tiles layout: a section heading and tiles of different sizes, each able to hold a stat, a chart, a quote or a photo. For a ready layout, use BentoCards or BentoMedia.

File
Bento.astro
Group
Marketing sections
Kind
Static: no JavaScript
Examples
5
import Bento from "@astronomic/ui-pro/components/Bento.astro";

Examples

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

  • Static
  • Interactive
  • Framed

A mixed bento

The section is a shell: the eyebrow, the heading and the text, then the tiles in the default slot, one BentoTile each, on the grid you pass in listClass. Built by hand, a tile can hold any visual in its media slot: a code snippet on the large inverse tile (one link, with a viewText cue), a photo behind the text on the tall one, a stat, a row of theme names and a small picture of presets. One tile is a link, so the grid is bentoGridSparse and the tiles are ordered to leave no hole. BentoCards and BentoMedia are recipes built on the same shell. childHeadingTag() in lib/heading.ts gives the titles' level.

main.astro

Sizes and packing

One wide, one tall, one large and four normal tiles, labeled by size. With no links the grid is bentoGrid, which packs dense: the normal tiles fill the holes the wide, large and tall tiles leave, so the visual order differs from the source order. From 48rem it has four columns, from 32rem two (wide and large take the full row), below that one.

sizes.astro

Images in three places

An image behind the text on the large tile (on a scrim that reads on any photo), above the text on the tall one, and beside the text at the start on a wide one, once that tile is 28rem wide. The other tiles are text only.

images.astro

Heading with emphasis and a mark

emphasis turns the *phrase* in "Built for *the long run*" into <em>. The mark "(04)" sits beside the heading, outside it, and a screen reader hears its markLabel, "4 strengths". A Badge sits in the eyebrow slot.

emphasis.astro

Without a heading

With no heading, Bento is a plain <div> that holds only the tiles. Your own h2 goes above it, and since the shell has no itemHeadingTag, you set each tile's headingTag to "h3" by hand (or pass childHeadingTag({ itemHeadingTag: "h2" })).

headingless.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.