Skip to content

Action Card

Reduction action card: serif title, description, saving and cost figures, leaf-rated impact/effort, and an “Add to plan” pill that toggles to a sage “In your plan” state.

organic-soft/ui/action-card
Open ↗

Source

"use client";

import { useState } from "react";
import { Check, Leaf, Plus } from "lucide-react";
import { cn } from "@/lib/utils";

export interface ActionCardProps {
  title?: string;
  description?: string;
  saving?: string;
  cost?: string;
  impact?: 1 | 2 | 3;
  effort?: 1 | 2 | 3;
  defaultAdded?: boolean;
  onAddedChange?: (added: boolean) => void;
  className?: string;
}

/** Reduction action card: serif title, description, saving and cost figures, leaf-rated impact/effort, and an “Add to plan” pill that toggles to a sage “In your plan” state. */
export function ActionCard({
  title = "Switch offices to green electricity",
  description = "Move your two offices to a certified renewable tariff. Usually cost-neutral within a year.",
  saving = "−42 tCO₂e / yr",
  cost = "≈ €0 – €600 / yr",
  impact = 3,
  effort = 1,
  defaultAdded = false,
  onAddedChange,
  className,
}: ActionCardProps) {
  const [added, setAdded] = useState(defaultAdded);
  const leaves = (n: number) => [1, 2, 3].map((i) => <Leaf key={i} aria-hidden className={cn("size-3.5", i <= n ? "fill-current" : "opacity-30")} />);
  const word = { 1: "low", 2: "medium", 3: "high" } as const;
  return (
    <article
      className={cn(
        "da-transition flex max-w-sm flex-col rounded-da-lg bg-da-surface p-6 text-da-surface-fg shadow-da-sm",
        added && "ring-2 ring-da-primary",
        className,
      )}
    >
      <h3 className="font-da-display text-2xl leading-tight">{title}</h3>
      <p className="mt-2 text-da-muted-fg">{description}</p>
      <dl className="mt-5 grid grid-cols-2 gap-3 text-sm">
        <div className="rounded-da-md bg-da-accent p-3 text-da-accent-fg">
          <dt className="opacity-80">Saving</dt>
          <dd className="mt-0.5 font-da-mono font-medium">{saving}</dd>
        </div>
        <div className="rounded-da-md bg-da-surface-2 p-3">
          <dt className="text-da-muted-fg">Cost</dt>
          <dd className="mt-0.5 font-da-mono">{cost}</dd>
        </div>
      </dl>
      <p className="mt-4 flex flex-wrap gap-x-5 gap-y-1 text-sm">
        <span className="inline-flex items-center gap-1.5 text-da-primary">
          <span className="flex">{leaves(impact)}</span>
          <span className="text-da-fg">{word[impact]} impact</span>
        </span>
        <span className="inline-flex items-center gap-1.5 text-da-muted-fg">
          <span className="flex">{leaves(effort)}</span>
          <span className="text-da-fg">{word[effort]} effort</span>
        </span>
      </p>
      <button
        type="button"
        aria-pressed={added}
        onClick={() => {
          setAdded(!added);
          onAddedChange?.(!added);
        }}
        className={cn(
          "da-focus da-transition mt-6 inline-flex h-11 items-center justify-center gap-2 rounded-da-pill font-medium",
          added ? "bg-da-primary text-da-primary-fg" : "bg-da-accent text-da-accent-fg hover:brightness-95",
        )}
      >
        {added ? <Check aria-hidden className="size-4" /> : <Plus aria-hidden className="size-4" />}
        {added ? "In your plan" : "Add to plan"}
      </button>
    </article>
  );
}

export default ActionCard;

modules/organic-soft/ui/action-card/index.tsx

Props

PropTypeDefaultDescription
titlestring—Heading.
descriptionstring—Supporting text.
savingstring—Saving.
coststring—Cost.
impact1 | 2 | 3—Impact.
effort1 | 2 | 3—Effort.
defaultAddedboolean—Default Added.
onAddedChange(added: boolean) => void—Callback.
classNamestring—Extra classes on the root.

Other card variants in Organic Soft

Card in other art directions

Card

Composable card (Card, CardHeader, CardKicker, CardTitle, CardDescription, CardContent, CardFooter) with 5 solid tones, 3 hard-shadow depths and an interactive press-on-hover mode.

BrutalistCard

Profile Card

User/team member card: striped blue banner with status chip, overlapping yellow initials square, uppercase name and mono role, bio, ruled stat strip and a split action bar.

BrutalistCard

Release Card

Changelog entry card: yellow version/date column (top bar on mobile), uppercase title (optional link), summary and a list of changes tagged new / improved / fixed / breaking with fixed-width colored labels.

BrutalistCard

Stat Card

KPI card: mono label, icon square, giant value, green/red delta chip with arrow, and an outlined mini bar chart whose last bar is filled. Four solid tones.

BrutalistCard

Card

Composable frosted card (Card, CardHeader, CardTitle, CardDescription, CardContent, CardFooter) with frosted / tinted-gradient / solid variants, specular top edge and interactive lift.

GlassCard

Meeting Card

Meeting recap glass card: title, time / duration / platform meta, gradient participant stack with +N, AI summary panel, action items with checkboxes and owners, and a transcript link.

GlassCard

Profile Card

Teammate glass card: gradient cover, large initials avatar with presence dot, role and timezone, status pill, three stats, expertise tags and Message / Schedule actions.

GlassCard

Stat Ring Card

KPI glass card with a primary→accent gradient progress ring (SVG) showing the percentage, the value over its max and a caption; the ring draws in on mount.

GlassCard

Card

Composable hairline card (Card, CardHeader, CardTitle, CardDescription, CardContent, CardFooter) with default / raised / ghost variants and an interactive hover lift.

MinimalCard

Incident Card

Incident summary card: severity chip, id and duration, linked title, service chips, a 4-step status progress bar, commander avatar, stacked responder avatars and update count.

MinimalCard

Integration Card

Integration tile: logo/monogram, name, category, description, a Radix Switch to enable it, live status meta and a Configure link. Controlled or uncontrolled.

MinimalCard

Metric Card

KPI card: muted label, big mono value, inline SVG sparkline with area fill and end dot, and a colored delta chip vs. the previous period (lowerIsBetter flips the colors).

MinimalCard

Profile Card

Studio/person profile card in the Read.cv spirit: square gray portrait with initials, name, role and city in mono, availability dot in signal color, short bio and a list of links with ↗.

Mono CleanCard

Project Card

Portfolio project card: neutral image frame that darkens slightly on hover with a “View case ↗” overlay, then a mono meta row (index, client, year) and the title with discipline tags.

Mono CleanCard

Stat Card

Analytics stat: mono label, large display value, change in mono, and a row of thin vertical bars (last bar in ink, others gray) — no chart chrome.

Mono CleanCard

Template Card

Template tile: a wireframe preview drawn with hairlines (nav, giant title, image grid) in a bordered frame, then name, author, category and usage count, with a “Use template” button revealed on hover/focus.

Mono CleanCard

Account Card

Bank account card: institution + masked number header, big balance with available amount, sync timestamp, and three recent inflow/outflow rows.

Neo CorporateCard

Invoice Card

Invoice summary card: number + status, bill-to and dates grid, line items table with mono amounts, subtotal/tax/total, and download/send actions.

Neo CorporateCard

Kpi Card

Metric card: label, big mono value, colored delta vs. period and an area sparkline in the primary color along the bottom.

Neo CorporateCard

Plan Card

Billing/subscription card: current plan + price + renewal date, usage meters (progressbar semantics, turning amber at 80% and red at 95%), manage and upgrade actions.

Neo CorporateCard

Profile Card

Rounded teammate card: pastel header band, big emoji avatar in a white circle, name, role, status pill, three stats in soft wells, skill pills and a “Say hi” button.

Soft FlatCard

Project Card

Pastel project card: white emoji tile, name link covering the card, description, chunky rounded progress bar with percentage, tasks-left and due chips, member dots.

Soft FlatCard

Stat Card

Friendly KPI tile: emoji in a white circle, change pill, label, big rounded number and a row of rounded mini bars (last one highlighted); five tones.

Soft FlatCard

Task Card

Kanban task card: round done checkbox with bouncy tick, pastel label, title (struck when done), subtask progress, due chip that turns red when overdue, comment/attachment counts and avatar dots.

Soft FlatCard