
Hospitality
A café menu the owners update every morning
+41%online orders in the first quarter
Data displayCardResult
Searchastronomic.dev# CardResult
For case studies and other proof: a photo, a short label, the title and one result shown large, like “−34% lead time”.
Static: no JavaScript.
## Usage
```astro
import CardResult from "@astronomic/ui-pro/components/CardResult.astro";
```
## Examples
### A case study
One linked card: a click anywhere opens the case study. The result sits on a hairline under the title, in the stat role, sized to the card.
```astro
---
import CardResult from "@astronomic/ui-pro/components/CardResult.astro";
// Your own image file.
import plants from "../../photos/plants-shelf.webp";
---
<div class="max-w-sm">
<CardResult
image={{ src: plants, alt: "Potted plants on a shelf by the café window." }}
eyebrow="Hospitality"
title="A café menu the owners update every morning"
result={{ value: "+41%", label: "online orders in the first quarter" }}
href="#greenhouse"
/>
</div>
```
### Open on the page
With card={false}: no fill, edge or padding, the photo with media corners. The same order and the same one link.
```astro
---
import CardResult from "@astronomic/ui-pro/components/CardResult.astro";
// Your own image file.
import stairway from "../../photos/white-stairway.webp";
---
<!-- card={false}: no fill, edge or padding; the photo keeps its media corners. -->
<div class="max-w-sm">
<CardResult
card={false}
image={{ src: stairway, alt: "" }}
eyebrow="Real estate"
title="Floor plans and leasing, in one quiet page"
result={{ value: "−34%", label: "time from first visit to signed lease" }}
href="#atrium"
/>
</div>
```
### A row of case studies
Three cards in a list under the section's h2 (SectionHead; each title is an h3), as many columns as fit, each at least 18rem, with a sizes hint for the row (gridImageSizes(3)). Each card fills its row, so the results line up.
```astro
---
import SectionHead from "@astronomic-dev/ui/components/SectionHead.astro";
import CardResult from "@astronomic/ui-pro/components/CardResult.astro";
import { gridImageSizes } from "@astronomic-dev/ui/lib/image.ts";
// Your own image files.
import plants from "../../photos/plants-shelf.webp";
import stairway from "../../photos/white-stairway.webp";
import concrete from "../../photos/concrete-slab.webp";
const cases = [
{ eyebrow: "Hospitality", title: "A café menu the owners update every morning", result: { value: "+41%", label: "orders made online" }, image: plants, href: "#greenhouse" },
{ eyebrow: "Real estate", title: "Floor plans and leasing, in one quiet page", result: { value: "−34%", label: "time to a signed lease" }, image: stairway, href: "#atrium" },
{ eyebrow: "Public", title: "Events and rooms for a new library branch", result: { value: "3×", label: "room bookings made online" }, image: concrete, href: "#library" },
];
---
<!-- The cards under their section's h2 (each title is an h3). As many columns as fit, each at least 18rem (auto-fit:
one column at 320px, a few cards stretch to fill the row). Each card fills its row, so the results line up on one line. -->
<section aria-labelledby="cases-heading" class="@container/cases mx-auto grid max-w-6xl gap-blocks">
<SectionHead heading="Proof, *in plain numbers.*" emphasis id="cases-heading" />
<ul role="list" class="m-0 grid list-none grid-cols-[repeat(auto-fit,minmax(min(100%,18rem),1fr))] gap-cards p-0">
{
cases.map((c) => (
<CardResult as="li" image={{ src: c.image, alt: "" }} imageSizes={gridImageSizes(cases.length)} eyebrow={c.eyebrow} title={c.title} result={c.result} href={c.href} />
))
}
</ul>
</section>
```
### A long figure in a narrow card
In a 20rem column, $12,500,000+ (wider than the role's default room) shrinks to stay on one line, and the long label wraps under it.
```astro
---
import CardResult from "@astronomic/ui-pro/components/CardResult.astro";
// Your own image file.
import folders from "../../photos/folder-stack.webp";
---
<!-- A 20rem column: the wide figure shrinks to stay on one line, and the label wraps under it. -->
<div class="max-w-xs">
<CardResult
image={{ src: folders, alt: "" }}
eyebrow="Publishing"
title="An archive of every issue since 1998, open to readers at last"
result={{ value: "$12,500,000+", label: "raised for the archive in its first year, most of it from readers who found it through search" }}
href="#archive"
/>
</div>
```
## Props
### CardResult
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `image` | `MediaImage` | None | The photo on top (Media; the ratio defaults to 5/4). Write its alt, or "" when the title says it all. |
| `imageComponent` | `ImageComponent` | None | Your image component for the photo (Media's imageComponent): Astro's <Image>, or a small wrapper for your CMS. |
| `imageSizes` | `string` | None | How wide the photo shows, for imageComponent's sizes. In a grid, gridImageSizes(count) from lib/image.ts. |
| `eyebrow` | `string` | None | A short label above the title, such as the client's industry. |
| `marker` | `IconComponent` | None | A small mark before the eyebrow: your icon component (e.g. a star), at the small icon size. Decorative. Shown only with an eyebrow. |
| `title` | `string` | None | Required. The title. With href it is the link's text. |
| `result` | `CardResultFigure` | None | Required. The result, shown large: { value, label }. value is your own text ("−34%", "+11 pts", "$1.8m"), never wrapped: a wide one shrinks to fit the card, but only down to 1.25rem, so keep it short (a figure with its sign or unit, about 12 characters at most) or it runs out of a narrow card. Put the words in label, which says what it measures. Without a result, use CardMedia. |
| `href` | `string` | None | Makes the whole card one link to this page; the title is its name. |
| `card` | `boolean` | `true` | Draws it as a Card (fill, edge, padding). Off, it sits open on the page: no Card, the photo with media corners. |
| `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.
- One link: the title. A click anywhere on the card follows it, and the focus ring goes round the whole card. Do not put other links or buttons in a linked card.
- The result is text after the title; write the figure as you want it read ("−34%").
- The marker is decoration and is hidden from screen readers.
- The photo needs alt like any Media. When the title already says it all, use alt="".
For case studies and other proof: a photo, a short label, the title and one result shown large, like “−34% lead time”.
Drag the orange handle to set the width. Frames get real breakpoints.
One linked card: a click anywhere opens the case study. The result sits on a hairline under the title, in the stat role, sized to the card.

Hospitality
+41%online orders in the first quarter
examples/cardresult/main.astro
---
import CardResult from "@astronomic/ui-pro/components/CardResult.astro";
// Your own image file.
import plants from "../../photos/plants-shelf.webp";
---
<div class="max-w-sm">
<CardResult
image={{ src: plants, alt: "Potted plants on a shelf by the café window." }}
eyebrow="Hospitality"
title="A café menu the owners update every morning"
result={{ value: "+41%", label: "online orders in the first quarter" }}
href="#greenhouse"
/>
</div>With card={false}: no fill, edge or padding, the photo with media corners. The same order and the same one link.

Real estate
−34%time from first visit to signed lease
examples/cardresult/open.astro
---
import CardResult from "@astronomic/ui-pro/components/CardResult.astro";
// Your own image file.
import stairway from "../../photos/white-stairway.webp";
---
<!-- card={false}: no fill, edge or padding; the photo keeps its media corners. -->
<div class="max-w-sm">
<CardResult
card={false}
image={{ src: stairway, alt: "" }}
eyebrow="Real estate"
title="Floor plans and leasing, in one quiet page"
result={{ value: "−34%", label: "time from first visit to signed lease" }}
href="#atrium"
/>
</div>Three cards in a list under the section's h2 (SectionHead; each title is an h3), as many columns as fit, each at least 18rem, with a sizes hint for the row (gridImageSizes(3)). Each card fills its row, so the results line up.
This preview did not load.
examples/cardresult/grid.astro
---
import SectionHead from "@astronomic-dev/ui/components/SectionHead.astro";
import CardResult from "@astronomic/ui-pro/components/CardResult.astro";
import { gridImageSizes } from "@astronomic-dev/ui/lib/image.ts";
// Your own image files.
import plants from "../../photos/plants-shelf.webp";
import stairway from "../../photos/white-stairway.webp";
import concrete from "../../photos/concrete-slab.webp";
const cases = [
{ eyebrow: "Hospitality", title: "A café menu the owners update every morning", result: { value: "+41%", label: "orders made online" }, image: plants, href: "#greenhouse" },
{ eyebrow: "Real estate", title: "Floor plans and leasing, in one quiet page", result: { value: "−34%", label: "time to a signed lease" }, image: stairway, href: "#atrium" },
{ eyebrow: "Public", title: "Events and rooms for a new library branch", result: { value: "3×", label: "room bookings made online" }, image: concrete, href: "#library" },
];
---
<!-- The cards under their section's h2 (each title is an h3). As many columns as fit, each at least 18rem (auto-fit:
one column at 320px, a few cards stretch to fill the row). Each card fills its row, so the results line up on one line. -->
<section aria-labelledby="cases-heading" class="@container/cases mx-auto grid max-w-6xl gap-blocks">
<SectionHead heading="Proof, *in plain numbers.*" emphasis id="cases-heading" />
<ul role="list" class="m-0 grid list-none grid-cols-[repeat(auto-fit,minmax(min(100%,18rem),1fr))] gap-cards p-0">
{
cases.map((c) => (
<CardResult as="li" image={{ src: c.image, alt: "" }} imageSizes={gridImageSizes(cases.length)} eyebrow={c.eyebrow} title={c.title} result={c.result} href={c.href} />
))
}
</ul>
</section>In a 20rem column, $12,500,000+ (wider than the role's default room) shrinks to stay on one line, and the long label wraps under it.

$12,500,000+raised for the archive in its first year, most of it from readers who found it through search
examples/cardresult/long-figure.astro
---
import CardResult from "@astronomic/ui-pro/components/CardResult.astro";
// Your own image file.
import folders from "../../photos/folder-stack.webp";
---
<!-- A 20rem column: the wide figure shrinks to stay on one line, and the label wraps under it. -->
<div class="max-w-xs">
<CardResult
image={{ src: folders, alt: "" }}
eyebrow="Publishing"
title="An archive of every issue since 1998, open to readers at last"
result={{ value: "$12,500,000+", label: "raised for the archive in its first year, most of it from readers who found it through search" }}
href="#archive"
/>
</div>