
Journal
How we plan a ten-week build
Weekly rounds, real pages every Friday, and no surprises at launch. Here is the plan we send every new client.
Data displayCardSide
Searchastronomic.dev# CardSide
For one or two featured items with room to spare: the image beside the text, stacked in a narrow column.
Static: no JavaScript.
## Usage
```astro
import CardSide from "@astronomic-dev/ui/components/CardSide.astro";
```
## Examples
### Image beside the text
Side by side, about 2 to 3, while the card's content is at least 32rem wide.
```astro
---
import CardSide from "@astronomic-dev/ui/components/CardSide.astro";
// Your own image file.
import wireframes from "../../photos/sketching-wireframes.webp";
---
<CardSide
image={{ src: wireframes, alt: "" }}
eyebrow="Journal"
title="How we plan a ten-week build"
text="Weekly rounds, real pages every Friday, and no surprises at launch. Here is the plan we send every new client."
href="#journal"
viewText="Read the article"
/>
```
### In a narrow column
The same card stacks by its own width, so the narrow one shows the image on top.
```astro
---
import CardSide from "@astronomic-dev/ui/components/CardSide.astro";
// Your own image files.
import desk from "../../photos/studio-desk.webp";
import folders from "../../photos/folder-stack.webp";
---
<div class="grid gap-5 sm:grid-cols-[minmax(0,2fr)_minmax(0,1fr)]">
<CardSide image={{ src: desk, alt: "" }} title="Brand sprint" text="Two weeks to a name, a logo and a short style guide." href="#sprint" viewText="See the sprint" />
<CardSide image={{ src: folders, alt: "" }} title="Site care" text="Monthly updates and checks." href="#care" viewText="See care" />
</div>
```
## Props
### CardSide
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `image` | `MediaImage` | None | The image beside the text. MediaImage is Media's props; the ratio defaults to 4/3 here. |
| `eyebrow` | `string` | None | A short line above the title, such as a category. |
| `title` | `string` | None | The title. With href it is the link's text. |
| `text` | `string` | None | A line or two under the title. |
| `href` | `string` | None | Makes the whole card one link to this page. |
| `viewText` | `string` | None | A cue at the foot of the text, such as "Read the article". Shown only with `href`. |
| `headingTag` | `"h2" \| "h3" \| "h4"` | `"h3"` | The title's element. Pick the level that fits the page outline. |
| `as` | `HTMLTag` | `"article"` | The element to render. Use li inside a list. |
| `class` | `string` | None | More classes, merged with cn(), so yours win on conflicts. |
Any other attribute goes on the rendered element.
## Accessibility
- Renders an <article> by default, with the title as its heading at headingTag's level.
- The image comes first in the source and on screen, side by side or stacked, so the reading order never changes.
- With href, only the title is a link; its ::after covers the card, and the focus ring goes round the whole card. The viewText cue is hidden from screen readers.
- It switches by its own width, so it also stacks in a narrow column. It is a named container (card-side), so a part inside it that queries an unnamed container is not affected.
For one or two featured items with room to spare: the image beside the text, stacked in a narrow column.
Drag the orange handle to set the width. Frames get real breakpoints.
Side by side, about 2 to 3, while the card's content is at least 32rem wide.

Journal
Weekly rounds, real pages every Friday, and no surprises at launch. Here is the plan we send every new client.
examples/cardside/main.astro
---
import CardSide from "@astronomic-dev/ui/components/CardSide.astro";
// Your own image file.
import wireframes from "../../photos/sketching-wireframes.webp";
---
<CardSide
image={{ src: wireframes, alt: "" }}
eyebrow="Journal"
title="How we plan a ten-week build"
text="Weekly rounds, real pages every Friday, and no surprises at launch. Here is the plan we send every new client."
href="#journal"
viewText="Read the article"
/>The same card stacks by its own width, so the narrow one shows the image on top.

Two weeks to a name, a logo and a short style guide.

Monthly updates and checks.
examples/cardside/narrow.astro
---
import CardSide from "@astronomic-dev/ui/components/CardSide.astro";
// Your own image files.
import desk from "../../photos/studio-desk.webp";
import folders from "../../photos/folder-stack.webp";
---
<div class="grid gap-5 sm:grid-cols-[minmax(0,2fr)_minmax(0,1fr)]">
<CardSide image={{ src: desk, alt: "" }} title="Brand sprint" text="Two weeks to a name, a logo and a short style guide." href="#sprint" viewText="See the sprint" />
<CardSide image={{ src: folders, alt: "" }} title="Site care" text="Monthly updates and checks." href="#care" viewText="See care" />
</div>