Marketing sectionsWork
Searchastronomic.dev# Work
To build your own work showcase: a section heading, your projects and a link to all your work. For a ready layout, use WorkGrid, WorkList or WorkRail.
Static: no JavaScript.
## Usage
```astro
import Work from "@astronomic/ui-pro/components/Work.astro";
```
## Examples
### Slots
The section is a shell: the eyebrow, the heading and its mark, then one WorkCard per project in one list, then the actions slot (a "View all work" link). The shell sets no columns; WorkGrid, WorkList and WorkRail are recipes built on it.
```astro
---
import Button from "@astronomic-dev/ui/components/Button.astro";
import ArrowRight from "@lucide/astro/icons/arrow-right";
import Work from "@astronomic/ui-pro/components/Work.astro";
// Your own photos.
import concrete from "../../photos/concrete-slab.webp";
import desk from "../../photos/studio-desk.webp";
import plants from "../../photos/plants-shelf.webp";
import shelves from "../../photos/studio-shelves.webp";
import sketch from "../../photos/sketching-wireframes.webp";
import stairway from "../../photos/white-stairway.webp";
// Your projects, in the order you want them. Each photo's alt says what it shows; the title is the card's link.
const projects = [
{ title: "Larkspur Ceramics", href: "#larkspur", client: "Larkspur", year: "2026", services: ["Brand", "Web"], summary: "A shop for a two-person pottery studio, built around the kiln schedule.", image: { src: shelves, alt: "Plates and bowls on white shelves." } },
{ title: "Quarry Street Library", href: "#quarry", client: "City of Ashford", year: "2026", services: ["Web", "Wayfinding"], summary: "Signs and a site that send readers to the right floor.", image: { src: stairway, alt: "A white stairwell seen from above." } },
{ title: "Fernhill Plant Rooms", href: "#fernhill", client: "Fernhill", year: "2025", services: ["Brand"], summary: "A calm name and mark for a plant shop with two rooms.", image: { src: plants, alt: "Two potted plants on a wooden shelf." } },
{ title: "Slate & Sky Architects", href: "#slate", client: "Slate & Sky", year: "2025", services: ["Web", "Motion"], summary: "A portfolio that lets the buildings speak first.", image: { src: concrete, alt: "A concrete building against a pale sky." } },
{ title: "Wireframe Weekly", href: "#wireframe", client: "Astronomic", year: "2024", services: ["Editorial"], summary: "A newsletter on sketching pages before the first pixel.", image: { src: sketch, alt: "A hand sketching page layouts beside a mug." } },
{ title: "The Desk Edition", href: "#desk", client: "Astronomic", year: "2024", services: ["Product", "Web"], summary: "A small store for the prints on our studio wall.", image: { src: desk, alt: "A laptop, a framed print and a cactus on a light wood desk." } },
];
---
<!-- The shell with its slots: the eyebrow, the heading and its mark, the cards (one WorkCard per project) and the actions after the list. The shell sets no columns: a recipe does. -->
<div class="mx-auto max-w-6xl px-6 py-10">
<Work heading="Selected work" mark="(06)" markLabel="6 projects" items={projects.slice(0, 2)} listClass="gap-blocks">
<span slot="eyebrow" class="text-eyebrow text-muted">(002) Work</span>
<Button slot="actions" href="#work" variant="secondary" roll iconTile={ArrowRight}>View all work</Button>
</Work>
</div>
```
## Props
### Work
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `heading` | `string` | None | The section heading. Without it there is no section and no header: a plain <div> holds only the work. |
| `emphasis` | `boolean` | `false` | Turn one *phrase* in the heading into <em>, as in "Work *we are proud of*". Off by default, so the heading shows as typed. |
| `mark` | `string` | None | A short mark after the heading, such as "(12)", in small muted type, outside the heading. Shown only with a heading. |
| `markLabel` | `string` | None | What the mark says to a screen reader, such as "12 projects". Without it, the mark is read as written. |
| `text` | `string` | None | One or two sentences under the heading. Shown only with a heading. |
| `headingTag` | `"h2" \| "h3" \| "h4"` | `"h2"` | The heading element. Each project's title sits one level under it. |
| `itemHeadingTag` | `"h2" \| "h3" \| "h4" \| "h5"` | None | The title element when there is no heading (h3 if unset). With a heading, titles sit one level under it. |
| `items` | `WorkItem[]` | None | Required, one or more (empty stops the build): { title, href, image, client?, year?, services?, summary?, transitionName? } (WorkItem, exported from each recipe). image is { src, alt, width?, height?, ratio?, focalPoint?, loading? } (MediaImage): write its alt. Only these fields reach the markup, so a CMS entry's other fields never land on the page. |
| `numbered` | `boolean` | `false` | Each title gets its place as a mark, "(01)", hidden from screen readers. |
| `numberFormat` | `"paren" \| "slash"` | `"paren"` | How a numbered list writes its marks: paren, "(01)", or slash, "01 /" (the slash in the mark's own quiet type). WorkCard's numberFormat; WorkList's rows take it too. numberMark() in lib/number-mark.ts writes the same mark for your own parts. |
| `grayscale` | `boolean` | `false` | Black and white photos, in color on hover and on focus. The fade (about 0.4s) runs only when motion is allowed. |
| `viewText` | `string` | None | A pill on each card's photo, such as "View case study", shown on hover and when focus is within the card (WorkCard's viewText). WorkList ignores it. |
| `imageComponent` | `ImageComponent` | None | Your image component, for every photo: Astro's <Image>, or a small wrapper for your CMS. |
| `imageSizes` | `string` | None | How wide each photo shows, as the sizes attribute, for your component's srcset. Each recipe gives its own default. |
| `align` | `"start" \| "center"` | `"start"` | For recipes. The alignment of the header (SectionHead) only. |
| `contentClass` | `string` | None | For recipes. Classes for the row that holds the header, the list and the actions. |
| `headerClass` | `string` | None | For recipes. Classes for the header (SectionHead). |
| `listClass` | `string` | None | For recipes. Classes for the list (the <ul>): its columns and gaps. It sits inside the work container, so its classes can query it (@3xl/work:...). |
| `itemClass` | `string` | None | For recipes. Classes for each project's <li>. |
| `ratioClass` | `string` | None | For recipes. Each card's photo shape in place of its ratio, such as aspect-[4/5]. |
| `listId` | `string` | None | For recipes. The list's id, so the recipe's controls can name it (aria-controls). |
| `class` | `string` | None | More classes for the root (the <section>, or the <div> without a heading), merged with cn(). The root is a named size container (work). |
| Slot | Description |
| --- | --- |
| `eyebrow` | A short line above the heading, such as "(002) Work". Shown only with a heading. |
| `controls` | For recipes. Controls at the end of the header's row, such as WorkRail's arrows. |
| `actions` | After the list: a "View all work" link or Button. |
| `default` | For recipes. The list's own <li>s in place of the cards, such as WorkList's rows. |
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. Without one, a plain <div>: put your own heading above it.
- The projects are one list (<ul role="list">). Each project is one link, its title, which sits one level under the section heading (h2 gives h3).
- With numbered, "(01)" sits before each title, hidden from screen readers, so the link's name is the title alone.
- The year on the photo is plain text in the scrim colors, not a control.
- grayscale turns a photo to color on hover and on focus inside the card, so a keyboard reader sees it too. The fade runs only when motion is allowed: under reduced motion or a calm theme the photo changes at once.
- viewText's pill ("View case study", on a card's photo) is hidden from screen readers and takes no pointer: the link's name stays the title. It shows on hover and when focus is within the card; it fades in only when motion is allowed. WorkList ignores viewText.
- transitionName names the photo for your view transition only when motion is allowed.
Work
ProTo build your own work showcase: a section heading, your projects and a link to all your work. For a ready layout, use WorkGrid, WorkList or WorkRail.
- File
- Work.astro
- Group
- Marketing sections
- Kind
- Static: no JavaScript
- Examples
- 1
Examples
Drag the orange handle to set the width. Frames get real breakpoints.
- Static
- Interactive
- Framed
Slots
The section is a shell: the eyebrow, the heading and its mark, then one WorkCard per project in one list, then the actions slot (a "View all work" link). The shell sets no columns; WorkGrid, WorkList and WorkRail are recipes built on it.
This preview did not load.
main.astro
examples/work/main.astro
---
import Button from "@astronomic-dev/ui/components/Button.astro";
import ArrowRight from "@lucide/astro/icons/arrow-right";
import Work from "@astronomic/ui-pro/components/Work.astro";
// Your own photos.
import concrete from "../../photos/concrete-slab.webp";
import desk from "../../photos/studio-desk.webp";
import plants from "../../photos/plants-shelf.webp";
import shelves from "../../photos/studio-shelves.webp";
import sketch from "../../photos/sketching-wireframes.webp";
import stairway from "../../photos/white-stairway.webp";
// Your projects, in the order you want them. Each photo's alt says what it shows; the title is the card's link.
const projects = [
{ title: "Larkspur Ceramics", href: "#larkspur", client: "Larkspur", year: "2026", services: ["Brand", "Web"], summary: "A shop for a two-person pottery studio, built around the kiln schedule.", image: { src: shelves, alt: "Plates and bowls on white shelves." } },
{ title: "Quarry Street Library", href: "#quarry", client: "City of Ashford", year: "2026", services: ["Web", "Wayfinding"], summary: "Signs and a site that send readers to the right floor.", image: { src: stairway, alt: "A white stairwell seen from above." } },
{ title: "Fernhill Plant Rooms", href: "#fernhill", client: "Fernhill", year: "2025", services: ["Brand"], summary: "A calm name and mark for a plant shop with two rooms.", image: { src: plants, alt: "Two potted plants on a wooden shelf." } },
{ title: "Slate & Sky Architects", href: "#slate", client: "Slate & Sky", year: "2025", services: ["Web", "Motion"], summary: "A portfolio that lets the buildings speak first.", image: { src: concrete, alt: "A concrete building against a pale sky." } },
{ title: "Wireframe Weekly", href: "#wireframe", client: "Astronomic", year: "2024", services: ["Editorial"], summary: "A newsletter on sketching pages before the first pixel.", image: { src: sketch, alt: "A hand sketching page layouts beside a mug." } },
{ title: "The Desk Edition", href: "#desk", client: "Astronomic", year: "2024", services: ["Product", "Web"], summary: "A small store for the prints on our studio wall.", image: { src: desk, alt: "A laptop, a framed print and a cactus on a light wood desk." } },
];
---
<!-- The shell with its slots: the eyebrow, the heading and its mark, the cards (one WorkCard per project) and the actions after the list. The shell sets no columns: a recipe does. -->
<div class="mx-auto max-w-6xl px-6 py-10">
<Work heading="Selected work" mark="(06)" markLabel="6 projects" items={projects.slice(0, 2)} listClass="gap-blocks">
<span slot="eyebrow" class="text-eyebrow text-muted">(002) Work</span>
<Button slot="actions" href="#work" variant="secondary" roll iconTile={ArrowRight}>View all work</Button>
</Work>
</div>Minimal · Light