Skip to documentation

Design system / Sources & standards

Current repository source

stat-strip.tsx

src/components/editorial/stat-strip.tsx

This view contains the escaped source read during the deployment build. Code and policy text are unchanged. Markdown is shown as source, not rendered as a document. A new deployment refreshes the content.

import type { ComponentProps, ReactNode } from "react";
import { Text } from "@/components/ui/text";
import { cn } from "@/lib/utils";

export type SummaryStat = {
  id: string;
  label: string;
  value: ReactNode;
  description?: ReactNode;
};
/** Molecule: related facts, not a fetching/counting service or business dashboard. */
export function StatStrip({
  items,
  className,
  ...props
}: Omit<ComponentProps<"dl">, "children"> & { items: readonly SummaryStat[] }) {
  if (!items.length) return null;
  return (
    <dl
      {...props}
      data-slot="stat-strip"
      className={cn("grid gap-6 border-y py-6 sm:grid-cols-3", className)}
    >
      {items.map((item) => (
        <div key={item.id} className="min-w-0 space-y-2">
          <dt className="text-supporting text-text-muted">{item.label}</dt>
          <dd className="break-words text-title font-semibold tabular-nums">
            {item.value}
          </dd>
          {item.description != null && (
            <Text
              as="dd"
              variant="supporting"
              rhythm="loose"
              className="text-text-muted"
            >
              {item.description}
            </Text>
          )}
        </div>
      ))}
    </dl>
  );
}
All sources and standards
Current components and theme tokens. Fictional example data. Source views refresh on deployment; authors maintain contract notes.