Skip to content

Actions Table

Reduction plan table: round checkboxes mark actions done (row softens), owner and due date, mono savings, and a progress header showing tonnes secured toward the target.

organic-soft/ui/actions-table
Open ↗

Source

"use client";

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

export interface ActionRow {
  id: string;
  title: string;
  owner: string;
  due: string;
  saving: number;
  done?: boolean;
}

export interface ActionsTableProps {
  rows?: ActionRow[];
  target?: number;
  className?: string;
}

const DEFAULT_ROWS: ActionRow[] = [
  { id: "a1", title: "Switch offices to green electricity", owner: "Léa", due: "Mar 2026", saving: 42, done: true },
  { id: "a2", title: "Rail for trips under 5 hours", owner: "Sam", due: "Jun 2026", saving: 27 },
  { id: "a3", title: "Consolidate freight lanes", owner: "Tomás", due: "Sep 2026", saving: 38 },
  { id: "a4", title: "Right-size cloud instances", owner: "Priya", due: "Oct 2026", saving: 9, done: true },
  { id: "a5", title: "Supplier code of conduct", owner: "Ana", due: "Dec 2026", saving: 14 },
];

/** Reduction plan table: round checkboxes mark actions done (row softens), owner and due date, mono savings, and a progress header showing tonnes secured toward the target. */
export function ActionsTable({ rows = DEFAULT_ROWS, target = 120, className }: ActionsTableProps) {
  const [done, setDone] = useState(rows.filter((r) => r.done).map((r) => r.id));
  const secured = rows.filter((r) => done.includes(r.id)).reduce((s, r) => s + r.saving, 0);
  const pct = Math.min(100, Math.round((secured / target) * 100));
  return (
    <div className={cn("rounded-da-lg bg-da-surface text-da-surface-fg shadow-da-sm", className)}>
      <div className="p-6">
        <div className="flex flex-wrap items-baseline justify-between gap-2">
          <h3 className="font-da-display text-xl">Reduction plan</h3>
          <p aria-live="polite" className="text-sm text-da-muted-fg">
            <span className="font-da-mono text-da-fg">{secured}</span> of {target} tCO₂e secured
          </p>
        </div>
        <div
          role="progressbar"
          aria-label="Target progress"
          aria-valuemin={0}
          aria-valuemax={100}
          aria-valuenow={pct}
          className="mt-3 h-3 rounded-full bg-da-surface-2"
        >
          <div className="h-full rounded-full bg-da-primary transition-[width] duration-(--da-duration-slow) ease-da" style={{ width: `${pct}%` }} />
        </div>
      </div>
      <div className="relative overflow-x-auto" role="region" aria-label="Actions" tabIndex={0}>
        <table className="w-full min-w-[560px]">
          <caption className="sr-only">Reduction actions</caption>
          <thead className="text-left text-sm text-da-muted-fg">
            <tr>
              <th scope="col" className="w-12 px-6 py-2">
                <span className="sr-only">Done</span>
              </th>
              <th scope="col" className="px-3 py-2 font-normal">
                Action
              </th>
              <th scope="col" className="px-3 py-2 font-normal">
                Owner
              </th>
              <th scope="col" className="px-3 py-2 font-normal">
                Due
              </th>
              <th scope="col" className="px-6 py-2 text-right font-normal">
                Saving
              </th>
            </tr>
          </thead>
          <tbody>
            {rows.map((r) => {
              const on = done.includes(r.id);
              return (
                <tr key={r.id} className={cn("da-transition border-t border-da-border", on && "bg-da-accent/40")}>
                  <td className="px-6 py-3">
                    <label className="grid size-7 cursor-pointer place-items-center rounded-full border-2 border-da-border-strong has-checked:border-da-primary has-checked:bg-da-primary has-checked:text-da-primary-fg has-focus-visible:ring-3 has-focus-visible:ring-da-ring">
                      <input
                        type="checkbox"
                        checked={on}
                        onChange={() => setDone(on ? done.filter((x) => x !== r.id) : [...done, r.id])}
                        aria-label={`Mark “${r.title}” as done`}
                        className="sr-only"
                      />
                      {on && <Check aria-hidden className="size-4" strokeWidth={3} />}
                    </label>
                  </td>
                  <td className={cn("px-3 py-3 font-medium", on && "text-da-muted-fg line-through decoration-da-primary/60")}>{r.title}</td>
                  <td className="px-3 py-3 text-da-muted-fg">{r.owner}</td>
                  <td className="px-3 py-3 text-da-muted-fg">{r.due}</td>
                  <td className="px-6 py-3 text-right font-da-mono text-sm text-da-primary">−{r.saving} t</td>
                </tr>
              );
            })}
          </tbody>
        </table>
      </div>
    </div>
  );
}

export default ActionsTable;

modules/organic-soft/ui/actions-table/index.tsx

Props

PropTypeDefaultDescription
rowsActionRow[]—Rows.
targetnumber—Target.
classNamestring—Extra classes on the root.

Other table variants in Organic Soft

Table in other art directions

Data Table

Typed generic table with a yellow caption bar + toolbar slot, ruled rows, sortable columns (asc → desc → none), custom cell renderers, mobile column hiding, empty state and optional row click.

BrutalistTable

Expandable Table

Table with expandable rows: a ruled chevron square per row reveals a detail row underneath; the open row floods yellow. Single or multiple open rows.

BrutalistTable

Leaderboard Table

Ranked list with ink header, colored podium squares for the top 3, proportional background bars behind each row, rank-change chips (▲/▼) and big tabular values. Sorts by value automatically.

BrutalistTable

Simple Table

Server-safe static table: uppercase caption, ink header row with column rules, zebra rows, right-aligned mono numeric columns and an optional yellow totals footer.

BrutalistTable

Action Items Table

Action items table with Open / Done / All filter pills and counts, gradient checkboxes that strike tasks through, owner, due chip (overdue in red) and source meeting; empty state.

GlassTable

Data Table

Frosted table panel with title, description, pill search field and actions slot; rows are separated translucent rounded strips that brighten on hover. Typed generic columns, sorting, mobile hiding, empty state.

GlassTable

Meetings Table

Recent meetings glass table: title with gradient video icon and platform, date, mono duration, participant avatar stack and a recap status pill (ready, processing, private).

GlassTable

Usage Table

Team usage glass table: member, inline gradient bar of recorded hours relative to the top member, meetings count and hours saved, with a tinted totals row.

GlassTable

Data Table

Typed generic table with hairline rows, sortable headers, optional row selection (select-all with indeterminate state) and a floating bulk-action bar. Custom cells, mobile column hiding, empty state.

MinimalTable

Grouped Table

Services table grouped by team: collapsible tinted group rows with service count and alert subtotal, then rows with status dot, mono service name, owner, alerts and MTTA.

MinimalTable

Paginated Table

Audit-log table with client-side pagination: page-size select, “1–10 of 47” range, numbered pages with ellipsis and prev/next; mono timestamps and IPs, horizontal scroll on mobile.

MinimalTable

Uptime Table

Status-page uptime table: one row per service with 30 daily bars colored by threshold (≥ 99.99 %, ≥ 99 %, below), a current-status dot, the 30-day average and a legend.

MinimalTable

Changelog Table

Release log laid out as a table: mono version + ISO date column, a square type tag (New in signal color, Improved outlined, Fixed gray) and dash-listed notes; hairline rows.

Mono CleanTable

Data Table

Analytics table in pure typography: mono headers that sort (↑/↓ glyph, aria-sort), hairline rows, tabular numbers, inline hairline bars for share of views, and an ink total row.

Mono CleanTable

Projects Table

Studio project index (the classic portfolio list): large titles with client, discipline and year in mono columns; each row is one link that inverts to ink on hover with an ↗.

Mono CleanTable

Sites Table

Sites dashboard table: name + domain link, dot status in mono, template, updated time and a “…” Radix dropdown (open, duplicate, archive); hairline rows.

Mono CleanTable

Approvals Table

Bill approval queue: vendor + requester, category, mono amount and inline Approve / Reject buttons that turn the row into a decided state (with Undo); pending count in the header.

Neo CorporateTable

Data Table

Customer data table: sortable headers (aria-sort), row checkboxes with select-all (indeterminate), bulk-action bar when rows are selected, mono amounts and pagination.

Neo CorporateTable

Invoice Table

Receivables table with status pills, days-late aging text, mono amounts, a totals footer and a per-row Radix dropdown (view, send reminder, duplicate, void).

Neo CorporateTable

Ledger Table

General-ledger table grouped by date: journal ref and memo, GL account, debit/credit columns in mono, credits indented, and balanced totals row with a “Balanced” check.

Neo CorporateTable

Activity Table

Activity log table: kind icon in a pastel circle, emoji avatar and sentence (“Ana completed …”), board chip and relative time; rows highlight softly on hover.

Soft FlatTable

Simple Table

Plain friendly data table in a rounded white card: soft header well, roomy rows, gentle zebra and right-aligned numbers; generic columns and rows props.

Soft FlatTable

Task Table

“My tasks” table where each row is a soft rounded strip: round done checkbox, title (struck when done), pastel board chip, owner initial avatar and due chip (red when overdue).

Soft FlatTable

Workload Table

Team workload heat table: a row per person (emoji + name), one rounded cell per weekday tinted mint → butter → peach by number of tasks, with a legend.

Soft FlatTable