BulkActionBar
- Status
- Implemented
- Family
- 5 of 13
- Registry
- @lopifi/bulk-action-bar
npx shadcn@latest add @lopifi/theme @lopifi/bulk-action-barThe component, rendering
Real data, the shipped component. Switch the theme to check the claims the spec makes below.
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.
"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
- TransactionTableThe workhorse. Virtualized, sticky, priority-collapsing.
- TransactionRowDesktop row.Spec
- TransactionCardThe mobile re-rank.
- TransactionDetailFull detail sheet with attachments and audit trail.
- LedgerTableDouble-entry with debit/credit columns and a balance check.
- AgingTableAR/AP buckets, 0-30-60-90+.
- ReconciliationViewTwo-pane matcher. The match animation.
- CategoryPickerHierarchical with rule creation.
- FilterBarURL-param-backed filters with resolved-value chips.
- ColumnManagerShow/hide/reorder with drag.
- GroupPickerOne cut through a table, with subtotals per group.
- ExportMenuCSV/XLSX/PDF with a stated scope.
- TableColumnsSort and resize for a table that renders on the server.
- ColumnHeaderThe sortable, draggable header cell.
- PeriodGridThe ruled grid. Frozen panes, hidden columns, hover change, ⌘C.
See also
A component is specified in one place, defined in another, and running in a third. All three, from here.
- Ledger & tables — the family specThe four-layer specification this component was built against, before it was written.Doc
- Ledger tables and transaction registersThe family running, with real figures in it, in both themes and at every density.Live
- CatalogAll 179 components, specified before they are written.Doc
- TransactionA business event — a payment, a sale, a purchaseTerm
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.
- Ledger tables and transaction registers, runningThe Ledger & tables family, live. BulkActionBar has no demo of its own there yet.Live
- Ledger & tablesThe table is the product. It gets the same design investment as the hero card. Specs for 15 React components: TransactionTable, TransactionRow, TransactionCard, TransactionDetail and 11 more.Doc
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.