Media and text
Stacks on small screens with the media first. Pass items for a run of
rows that alternate sides on their own.
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
Options
Section titled “Options”eyebrow,title,text,bullets,actions: the copy.actionsis a list of{ label, href, variant? }; the first is solid and the rest outline unless setimage,imageAlt: the media imagevideo:{ src, poster?, label, background? }, rendered with Videomediaslot: code, an embed or anything else in place of an image (single row only)ratio:square,portrait,landscape(default),widereverse: puts the media on the end sideitems: a list of rows with the same fields as above. Rows alternate sides automatically,reverseflips the whole sequence, andtitle,eyebrowandintrobecome a centred section headerbleed: 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"/>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
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
Sections
Page parts such as Hero, Statement and Article.
Demo site
Built from its own sections
The demo site is a plain Astro site that uses the library as a consumer would.
npm install @samla/ui
import Button from "@samla/ui/Button.astro";