Data displayMedia

Open in Create
Search
astronomic.dev

Media

Free

For a photo or picture in a fixed shape, like a project image, with an optional caption. Round, or with one corner cut.

File
Media.astro
Group
Data display
Kind
Static: no JavaScript
Examples
4
import Media from "@astronomic-dev/ui/components/Media.astro";

Examples

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

  • Static
  • Interactive
  • Framed

Ratios and a caption

16/9 with a caption, 3/4, and a decorative 1/1 with alt="".

main.astro

Your own images

Astro's <Image> draws the photo (imageComponent={Image}), with no wrapper; the kit draws the frame and passes the sizes you set. Astro writes a srcset when your astro.config sets image.layout. For EmDash or another CMS, see "Your own images" in the kit README.

own-image.astro

Round portraits

shape="circle" makes the frame round and square at any width.

circle.astro

Cut corners

shape="cut" slices one corner off, with soft joins (45° unless the frame is under twice the cut size). cutCorner picks it in the writing direction, so right to left mirrors it.

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