PricingCards

apps/www/src/sections/PricingCards.astro · 37 lines · group Pricing

PricingCards — plans side by side, one <Plan> card per column, under a left-aligned heading. Use for: a price list with two to four tariffs to choose from. Not for: one rate only (<PricingSingle>); one plan that needs a long feature list (<PricingWide>); a price as a prompt for the next step (<CtaPrice>). Children: <Plan> tags, two to four; mark one `recommended` to highlight it. Layout: `columns` 2–4 (default 3). Default id is "pricing", so links can point at "/#pricing".

In the fleet

Not used by any site yet.

Samples 1

sample

What a season costs

Hardware included; cancel at the end of any season.

One field

A single station, the essentials.

  • One station
  • Air and soil sensors
  • SMS alerts

€19per month

Estate

Most popular

Up to ten stations and a gateway.

  • Ten stations
  • Leaf wetness and wind
  • Shared forecasts
  • Priority replacement

€39per month

Co-op

Several farms behind one gateway.

  • Unlimited stations
  • Per-farm access
  • API and exports
  • Named support

€79per month

MDX of this sample
<PricingCards title="What a season costs" description="Hardware included; cancel at the end of any season.">
  <Plan name="One field" price="€19" priceNote="per month" description="A single station, the essentials." features={['One station', 'Air and soil sensors', 'SMS alerts']} primaryText="Start" />
  <Plan name="Estate" price="€39" priceNote="per month" recommended description="Up to ten stations and a gateway." features={['Ten stations', 'Leaf wetness and wind', 'Shared forecasts', 'Priority replacement']} primaryText="Start" />
  <Plan name="Co-op" price="€79" priceNote="per month" description="Several farms behind one gateway." features={['Unlimited stations', 'Per-farm access', 'API and exports', 'Named support']} primaryText="Talk to us" />
</PricingCards>

Props

NameTypeRequiredDefaultDescription
idstring'pricing'anchor of the section (default "pricing")
titlestringthe section heading
descriptionstringa paragraph under the heading
columns2 | 3 | 43cards per row on desktop
theme'light' | 'muted' | 'dark' | 'brand' | 'brand-dark''light'background of the section

Source apps/www/src/sections/PricingCards.astro @ gitt.one

---
/**
 * PricingCards — plans side by side, one <Plan> card per column, under a
 *   left-aligned heading.
 *
 * Use for: a price list with two to four tariffs to choose from.
 * Not for: one rate only (<PricingSingle>); one plan that needs a long feature
 *   list (<PricingWide>); a price as a prompt for the next step (<CtaPrice>).
 * Children: <Plan> tags, two to four; mark one `recommended` to highlight it.
 * Layout: `columns` 2–4 (default 3). Default id is "pricing", so links can
 *   point at "/#pricing".
 */
import Section from './_Section.astro';
import type { Theme } from './_Section.astro';

interface Props {
  /** anchor of the section (default "pricing") */
  id?: string;
  /** the section heading */
  title?: string;
  /** a paragraph under the heading */
  description?: string;
  /** cards per row on desktop */
  columns?: 2 | 3 | 4;
  /** background of the section */
  theme?: Theme;
}
const { id = 'pricing', title, description, columns = 3, theme = 'light' } = Astro.props;
const cols = { 2: 'lg:grid-cols-2', 3: 'lg:grid-cols-3', 4: 'lg:grid-cols-2 xl:grid-cols-4' }[columns];
---

<Section id={id} title={title} description={description} theme={theme} heading="left">
  <div class:list={['grid grid-cols-1 gap-8', cols]} data-variant="cards">
    <slot />
  </div>
</Section>

Source links point to engine-astro@7b686388. Samples are demo content: the components are the real ones, the copy and the pictures are made up.