Blocks / Tool card

Tool card

A tool in a grid: monogram, name, summary, facts and the one thing to do.

import { ToolCard, ToolIcon } from "@forgeron/ui";
/01 → Default
  • Invoices sync

    1.4.0Live

    Brings supplier invoices from Odoo into the ledger every hour.

import { Badge, ToolCard } from "@forgeron/ui";

export default function Default() {
  return (
    <ul style={{ width: 280, margin: 0, padding: 0 }}>
      <ToolCard
        name="Invoices sync"
        summary="Brings supplier invoices from Odoo into the ledger every hour."
        href="#/tools/invoices-sync"
        onNavigate={() => {}}
        meta={
          <>
            <Badge mono>1.4.0</Badge>
            <Badge tone="success" dot>
              Live
            </Badge>
          </>
        }
      />
    </ul>
  );
}
/02 → Grid
  • Brings supplier invoices from Odoo into the ledger every hour.

  • Imports leads from a spreadsheet and matches them to existing contacts.

  • Carrier rates

    2.1.0Update

    Compares carrier prices for a parcel and books the cheapest pickup.

import { Badge, Button, ToolCard } from "@forgeron/ui";
import { useState } from "react";

const tools = [
  {
    name: "Invoices sync",
    summary: "Brings supplier invoices from Odoo into the ledger every hour.",
    version: "1.4.0",
    state: "live",
  },
  {
    name: "CRM import",
    summary: "Imports leads from a spreadsheet and matches them to existing contacts.",
    version: "0.9.2",
    state: "connect",
  },
  {
    name: "Carrier rates",
    summary: "Compares carrier prices for a parcel and books the cheapest pickup.",
    version: "2.1.0",
    state: "update",
  },
] as const;

// The whole card links to the tool; the footer button stays its own target.
export default function Grid() {
  const [opened, setOpened] = useState<string | null>(null);
  return (
    <div style={{ display: "grid", gap: 12, width: "100%" }}>
      <ul
        style={{
          display: "grid",
          gridTemplateColumns: "repeat(auto-fill, minmax(220px, 1fr))",
          gap: 12,
          margin: 0,
          padding: 0,
        }}
      >
        {tools.map((tool) => (
          <ToolCard
            key={tool.name}
            name={tool.name}
            summary={tool.summary}
            href={`#/tools/${tool.name}`}
            onNavigate={() => setOpened(tool.name)}
            meta={
              <>
                <Badge mono>{tool.version}</Badge>
                {tool.state === "update" ? <Badge tone="warning">Update</Badge> : null}
              </>
            }
            footer={
              tool.state === "connect" ? (
                <Button
                  size="sm"
                  variant="primary"
                  onClick={() => setOpened(`Connect ${tool.name}`)}
                >
                  Connect
                </Button>
              ) : (
                <Button size="sm" onClick={() => setOpened(`Open ${tool.name}`)}>
                  Open
                </Button>
              )
            }
          />
        ))}
      </ul>
      {opened ? <p style={{ margin: 0, color: "var(--ink-muted)" }}>Clicked: {opened}</p> : null}
    </div>
  );
}
/03 → Tool icon
import { ToolIcon } from "@forgeron/ui";

// A tool has no logo here: its first letters, black and white, sharp corners.
export default function ToolIcons() {
  return (
    <div style={{ display: "flex", alignItems: "center", gap: 12 }}>
      <ToolIcon name="Invoices sync" />
      <ToolIcon name="CRM import" />
      <ToolIcon name="Carrier rates" size="lg" />
    </div>
  );
}
API → Props
PropTypeDefaultDescription
namestring—Its first letters make the monogram.
summarystring—What it does; three lines at most.
hrefstring—The tool's page: the whole card links there.
onNavigate(href) => void—Routes a plain click without a page load.
metaReactNode—Small facts by the name: version, status.
footerReactNode—The one thing to do: Open, Connect. Stays clickable over the link.
classNamestring—Extra classes.