Marketing sectionsWorkGrid
Searchastronomic.dev# WorkGrid
To show your best projects large, two to a row, with the option of black and white photos that turn to color on hover.
Static: no JavaScript.
## Usage
```astro
import WorkGrid from "@astronomic/ui-pro/components/WorkGrid.astro";
```
## Examples
### Big cards
One column, two from a 48rem work container; every second card sits a block lower, so the grid reads as staggered. numbered puts "(01)" before each title, or "01 /" with numberFormat: "slash".
```astro
---
import Button from "@astronomic-dev/ui/components/Button.astro";
import ArrowRight from "@lucide/astro/icons/arrow-right";
import WorkGrid from "@astronomic/ui-pro/components/WorkGrid.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." } },
];
---
<div class="mx-auto max-w-6xl px-6 py-10">
<WorkGrid heading="Selected work" mark="(06)" markLabel="6 projects" items={projects} numbered>
<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>
</WorkGrid>
</div>
```
### Black and white
grayscale: every photo in black and white, in color while its card is hovered or holds focus. The fade runs only when motion is allowed.
```astro
---
import WorkGrid from "@astronomic/ui-pro/components/WorkGrid.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." } },
];
---
<!-- grayscale: every photo in black and white, in color while its card is hovered or holds focus. -->
<div class="mx-auto max-w-6xl px-6 py-10">
<WorkGrid heading="Selected work" items={projects.slice(0, 4)} grayscale numbered />
</div>
```
### Two projects, no heading
Without a heading there is no section: a plain <div> holds the list.
```astro
---
import WorkGrid from "@astronomic/ui-pro/components/WorkGrid.astro";
// Your own photos.
import plants from "../../photos/plants-shelf.webp";
import shelves from "../../photos/studio-shelves.webp";
const projects = [
{ title: "Larkspur Ceramics", href: "#larkspur", year: "2026", services: ["Brand", "Web"], image: { src: shelves, alt: "Plates and bowls on white shelves." } },
{ title: "Fernhill Plant Rooms", href: "#fernhill", year: "2025", services: ["Brand"], image: { src: plants, alt: "Two potted plants on a wooden shelf." } },
];
---
<!-- Two projects, no heading: a plain <div> with the list, no summaries. -->
<div class="mx-auto max-w-6xl px-6 py-10">
<WorkGrid items={projects} />
</div>
```
## Props
### WorkGrid
| 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. Default here: (min-width: 48rem) 50vw, 100vw. |
| `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. |
| `actions` | After the list: a "View all work" link or Button. |
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.
WorkGrid
ProTo show your best projects large, two to a row, with the option of black and white photos that turn to color on hover.
- File
- WorkGrid.astro
- Group
- Marketing sections
- Kind
- Static: no JavaScript
- Examples
- 3
Examples
Drag the orange handle to set the width. Frames get real breakpoints.
- Static
- Interactive
- Framed
Big cards
One column, two from a 48rem work container; every second card sits a block lower, so the grid reads as staggered. numbered puts "(01)" before each title, or "01 /" with numberFormat: "slash".
This preview did not load.
examples/workgrid/main.astro
---
import Button from "@astronomic-dev/ui/components/Button.astro";
import ArrowRight from "@lucide/astro/icons/arrow-right";
import WorkGrid from "@astronomic/ui-pro/components/WorkGrid.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." } },
];
---
<div class="mx-auto max-w-6xl px-6 py-10">
<WorkGrid heading="Selected work" mark="(06)" markLabel="6 projects" items={projects} numbered>
<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>
</WorkGrid>
</div>Black and white
grayscale: every photo in black and white, in color while its card is hovered or holds focus. The fade runs only when motion is allowed.
This preview did not load.
examples/workgrid/grayscale.astro
---
import WorkGrid from "@astronomic/ui-pro/components/WorkGrid.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." } },
];
---
<!-- grayscale: every photo in black and white, in color while its card is hovered or holds focus. -->
<div class="mx-auto max-w-6xl px-6 py-10">
<WorkGrid heading="Selected work" items={projects.slice(0, 4)} grayscale numbered />
</div>Two projects, no heading
Without a heading there is no section: a plain <div> holds the list.
This preview did not load.
examples/workgrid/few.astro
---
import WorkGrid from "@astronomic/ui-pro/components/WorkGrid.astro";
// Your own photos.
import plants from "../../photos/plants-shelf.webp";
import shelves from "../../photos/studio-shelves.webp";
const projects = [
{ title: "Larkspur Ceramics", href: "#larkspur", year: "2026", services: ["Brand", "Web"], image: { src: shelves, alt: "Plates and bowls on white shelves." } },
{ title: "Fernhill Plant Rooms", href: "#fernhill", year: "2025", services: ["Brand"], image: { src: plants, alt: "Two potted plants on a wooden shelf." } },
];
---
<!-- Two projects, no heading: a plain <div> with the list, no summaries. -->
<div class="mx-auto max-w-6xl px-6 py-10">
<WorkGrid items={projects} />
</div>