Skip to content

BulkActionBar

Selection count + actions, safe-area aware.
Implemented
Status
Implemented
Family
5 of 13
Registry
@lopifi/bulk-action-bar
npx shadcn@latest add @lopifi/theme @lopifi/bulk-action-bar

The component, rendering

Real data, the shipped component. Switch the theme to check the claims the spec makes below.

Preview

The four-layer spec

Appears when rows are selected. Bottom-anchored on phone with safe-area padding, inline on desktop. States the count (42 selected), offers actions, and names the destruction: "Delete 42 transactions", never "Delete". Enters with a 240ms translate + fade — occasional, so it's licensed.

Lifted verbatim from Ledger & tables. The doc and this page are the same paragraphs, so they cannot disagree.

What lands in your repository

One component is never one file. Everything below is copied into your project, where you own it.

Files

components/ledger/bulk-action-bar.tsx

Lopifi dependencies · 2
buttoncn
npm packages
class-variance-authorityclsxtailwind-merge
Registry entry
/r/bulk-action-bar.json

The whole component

No compiled bundle, no black box. This is the file the registry copies, and the file you will edit.

components/ledger/bulk-action-bar.tsx
"use client";

import { cn } from "@/lib/ledger/cn";
import { Button } from "@/components/ledger/button";

export interface BulkActionBarProps {
  /** Names the destruction: "Delete 42 transactions", never "Delete". */
  actions: { label: (count: number) => string; onClick: () => void; destructive?: boolean }[];
  className?: string;
  count: number;
  onClear: () => void;
}

/**
 * Bottom-anchored on phone with safe-area padding, inline on desktop.
 * Occasional, so the 240ms translate + fade is licensed.
 */
export function BulkActionBar({ count, actions, onClear, className }: BulkActionBarProps) {
  if (count === 0) return null;
  return (
    <div
      aria-label={`${count} selected`}
      className={cn(
        "ledger-enter fixed inset-x-4 bottom-4 z-dropdown flex flex-wrap items-center gap-3",
        "rounded-md border border-border bg-surface-raised px-4 py-3 shadow-elevation-3",
        "md:static md:inset-auto md:shadow-none",
        className,
      )}
      role="region"
      style={{ marginBottom: "env(safe-area-inset-bottom)" }}
    >
      <span className="numeric text-label font-medium">{count} selected</span>
      <div className="flex flex-wrap gap-2">
        {actions.map((a) => (
          <Button
            key={a.label(count)}
            onClick={a.onClick}
            size="sm"
            variant={a.destructive ? "destructive" : "secondary"}
          >
            {a.label(count)}
          </Button>
        ))}
      </div>
      <Button className="ml-auto" onClick={onClear} size="sm" variant="ghost">
        Clear selection
      </Button>
    </div>
  );
}

The accounting it encodes

Concepts this component renders. Each one is defined once, in the lexicon, and used identically in the code and the copy.

Also in Ledger & tables

See also

A component is specified in one place, defined in another, and running in a third. All three, from here.

Elsewhere in the system

Where BulkActionBar sits in the rest of the system — the live section it renders in, the calculators that compute what it displays, and the ledger payloads it is fed from.

Components are copied into your repository and meant to be edited — rounding policy, fiscal calendar and compliance copy differ per company.

Told when Ledger & tables changes

Components are copied into your repo, so a fix here does not reach you on its own. One email when a component in this family changes in a way that needs a migration — and nothing when it does not.

One address, no list rental, unsubscribe in one click.

Works in your QuickBooks Online or Xero file

Get your books closed every month

Lopifi is building AI bookkeeping that keeps your books closed on US GAAP as transactions happen, with a CPA review every quarter, for $200 a month. We’re not open yet.

$200/month when we open. No card now.