Download: platform cards
Download options with platform descriptions and optional download links.
pnpm dlx shadcn@latest add @haze/download-platform-cards---
import { ArrowDownToLine, Monitor, Smartphone } from "@lucide/astro";
import { cn } from "../../../lib/haze/utils";
interface Props {
id?: string;
eyebrow?: string;
title?: string;
description?: string;
headingLevel?: 1 | 2 | 3;
platforms?: { name: string; detail: string; kind: "desktop" | "mobile"; href?: string }[];
class?: string;
}
const {
id = "download-platform-cards",
eyebrow = "Take it with you",
title = "Your workspace, close at hand",
description = "Choose the version that fits how you work. The platforms below are examples.",
headingLevel = 2,
platforms = [
{ name: "Desktop app", detail: "For your desk and the workday ahead", kind: "desktop" },
{ name: "Mobile app", detail: "For a quick check-in on the move", kind: "mobile" },
],
class: className,
} = Astro.props;
const Heading = ({ 1: "h1", 2: "h2", 3: "h3" } as const)[headingLevel];
const PlatformHeading = ({ 1: "h2", 2: "h3", 3: "h4" } as const)[headingLevel];
---
<section aria-labelledby={`${id}-title`} class={cn("bg-background px-6 py-20 sm:py-24", className)}>
<div class="mx-auto max-w-5xl">
<div class="max-w-2xl">
<p class="text-[0.6875rem]/4 font-medium tracking-wider text-muted-foreground uppercase">{eyebrow}</p>
<Heading id={`${id}-title`} class="mt-3 text-3xl/9 font-semibold tracking-tight text-balance text-foreground sm:text-4xl/11">{title}</Heading>
<p class="mt-4 text-base/7 text-pretty text-muted-foreground">{description}</p>
</div>
<ul class="mt-12 grid gap-4 sm:grid-cols-2">
{platforms.map((platform) => {
const Icon = platform.kind === "desktop" ? Monitor : Smartphone;
return (
<li class="rounded-xl border border-border bg-card p-6 sm:p-8">
<span class="flex size-11 items-center justify-center rounded-lg bg-foreground/5 text-foreground inset-ring inset-ring-frame"><Icon aria-hidden="true" class="size-5" /></span>
<PlatformHeading class="mt-5 text-lg/7 font-semibold tracking-tight text-foreground">{platform.name}</PlatformHeading>
<p class="mt-2 text-sm/6 text-muted-foreground">{platform.detail}</p>
{platform.href ? <a href={platform.href} class="mt-6 inline-flex min-h-9 items-center gap-2 rounded-sm text-sm/5 font-medium text-foreground underline underline-offset-4 focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-ring"><ArrowDownToLine aria-hidden="true" class="size-4" />Download {platform.name}</a> : <p class="mt-6 text-[0.8125rem]/5 text-muted-foreground">Example download</p>}
</li>
);
})}
</ul>
</div>
</section>When to use
- A product has separate desktop and mobile downloads
- Visitors need a short explanation of each available app
When not to use
- The options are integrations with other products; use integrations-card-grid
Installation
Add the Haze registry to components.json once, then install Download: platform cards with the shadcn CLI. Works in any Astro project with Tailwind CSS v4.
pnpm dlx shadcn@latest add @haze/download-platform-cardsnpx shadcn@latest add @haze/download-platform-cardsyarn dlx shadcn@latest add @haze/download-platform-cardsbunx --bun shadcn@latest add @haze/download-platform-cardsFirst time? Registry and theme setup
1. Add to components.json:
{
"registries": {
"@haze": "http://localhost:4329/r/{name}.json"
}
}2. Install the theme once: npx shadcn@latest add @haze/theme, then import it after Tailwind in your global CSS:@import "./haze.css";
API reference
| Prop | Type | Default | Description |
|---|---|---|---|
| id | string | "download-platform-cards" | Unique section ID prefix. |
| eyebrow | string | "Take it with you" | Label above the heading. |
| title | string | demo heading | Download section heading. |
| description | string | demo copy | Introduction; the default marks platform entries as examples. |
| headingLevel | 1 | 2 | 3 | 2 | Heading level; platform names use the next level. |
| platforms | { name: string; detail: string; kind: 'desktop' | 'mobile'; href?: string }[] | 2 example platforms | Platforms and their download URLs. Entries without URLs show an example label. |
| class | string | – | Additional section classes. |
Keyboard interactions
- Tab
- Reach available download links.
Accessibility
- Platform names are headings inside a list and the icons are decorative.
- Download links include the platform name; entries without a URL have no inactive link.
Notes for AI
Copy into Claude Code, Cursor, Codex or any coding agent. Agents can also read the Markdown version of this page.
Install and use
Install the Haze UI block "Download: platform cards" with `npx shadcn@latest add @haze/download-platform-cards`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "http://localhost:4329/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import DownloadPlatformCards from "@/components/haze/blocks/download-platform-cards.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: http://localhost:4329/blocks/download-platform-cards.md
Customize with real content
Adapt the Haze download-platform-cards block for our product. Replace the demo values of these props with our real content: id, eyebrow, title, description, headingLevel, platforms, class. Keep the layout, the heading level rules and these accessibility details: Platform names are headings inside a list and the icons are decorative. Download links include the platform name; entries without a URL have no inactive link. Do not add raw color classes; use the Haze tokens.
Choose the right block
Before using download-platform-cards, check it fits: use it when a product has separate desktop and mobile downloads; visitors need a short explanation of each available app. Avoid it when the options are integrations with other products; use integrations-card-grid. Alternatives: @haze/integrations-card-grid.
Dependencies
- npm: @lucide/astro
- @haze/utils
- @haze/theme (one-time setup)
Source · Original Haze UI work.