Skip to content

Media and text

Stacks on small screens with the media first. Pass items for a run of rows that alternate sides on their own.

Placeholder for a component screenshot

Built to last

Write it once, use it everywhere

Every piece is a single Astro file with its own markup, styles and behaviour, so nothing drifts out of sync.

  • Static HTML by default
  • Scoped styles in every file
  • Works without JavaScript
  • eyebrow, title, text, bullets, actions: the copy. actions is a list of { label, href, variant? }; the first is solid and the rest outline unless set
  • image, imageAlt: the media image
  • video: { src, poster?, label, background? }, rendered with Video
  • media slot: code, an embed or anything else in place of an image (single row only)
  • ratio: square, portrait, landscape (default), wide
  • reverse: puts the media on the end side
  • items: a list of rows with the same fields as above. Rows alternate sides automatically, reverse flips the whole sequence, and title, eyebrow and intro become a centred section header
  • bleed: the media runs to the edge of the band (the viewport on a real page)
  • surface: light, alternate, brand, dark
<MediaText
eyebrow="Built to last"
title="Write it once, use it everywhere"
text="Every piece is a single Astro file with its own styles."
bullets={["Static HTML by default", "Scoped styles in every file"]}
actions={[{ label: "Get started", href: "/start/" }]}
image="/images/component.jpg"
imageAlt="A component file open in an editor"
/>
reverse ratio="portrait" surface="alternate"

Surfaces

Readable on every band

Surfaces remap colour tokens, so the same component works on light, alternate, brand and dark.

  • Static HTML by default
  • Scoped styles in every file
  • Works without JavaScript
items (alternating)

Layers

Three layers, one library

How the pieces fit together.

Elements

Small controls such as Button, Image and Tag.

  • Static HTML by default
  • Scoped styles in every file

Components

Composed pieces such as Card, Dialog and Tabs.

Sections

Page parts such as Hero, Statement and Article.

bleed surface="dark"

Demo site

Built from its own sections

The demo site is a plain Astro site that uses the library as a consumer would.

video, surface="brand"

See it in action

A background or controlled video beside the copy.

media slot
npm install @samla/ui

import Button from "@samla/ui/Button.astro";

Install in one line

Add the package and import the pieces you need.