Toast
- Status
- Implemented
- Family
- 8 of 13
- Registry
- @lopifi/toast
npx shadcn@latest add @lopifi/theme @lopifi/toastThe component, rendering
Real data, the shipped component. Switch the theme to check the claims the spec makes below.
The four-layer spec
Sonner, configured to our tokens. 400ms ease enter, 200ms exit, transitions not keyframes, stack offsets −0.05 scale / −16px / −0.2 opacity, swipe-dismiss at 45px or velocity > 0.11. Auto-dismiss pauses on tab hide.
Never the only channel for a critical error. Toasts are timed and dismissible; a failed payment persists inline.
Lifted verbatim from System & states. 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/toast.tsx
- Lopifi dependencies · 0
- None — the theme only.
- npm packages
- sonner
- Registry entry
- /r/toast.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 type * as React from "react";
import { Toaster as SonnerToaster, toast as sonnerToast } from "sonner";
/**
* Configured to our tokens: 400ms ease in, 200ms out, transitions not
* keyframes, stack offsets −0.05 scale / −16px / −0.2 opacity, swipe-dismiss
* at 45px. Auto-dismiss pauses on tab hide.
*
* Never the only channel for a critical error — toasts are timed and
* dismissible; a failed payment persists inline.
*/
export function Toaster() {
return (
<SonnerToaster
gap={8}
offset={24}
position="bottom-right"
style={
{
"--toast-transition-duration": "400ms",
"--width": "360px",
} as React.CSSProperties
}
toastOptions={{
classNames: {
actionButton: "ml-auto rounded-sm bg-accent px-3 py-1.5 text-label font-medium text-accent-fg",
cancelButton: "text-label text-text-secondary",
description: "text-caption text-text-secondary",
title: "text-body font-medium text-text-primary",
toast:
"flex w-full items-start gap-3 rounded-md border border-border bg-surface-raised p-4 shadow-elevation-2",
},
unstyled: true,
}}
visibleToasts={3}
/>
);
}
export const toast = sonnerToast;
Also in System & states
- EmptyStateThree variants. Always one next action.
- ErrorStateWith the financial reassurance sentence.
- SkeletonStructural, per-component.
- StaleIndicatorLast-synced + retry.
- CommandPaletteMotionless. Money-aware search.
- SheetVaul, configured. The mobile primary overlay.
- HoldToConfirmIrreversible actions, with accessible fallbacks.
- DensityTogglePersisted, synced, phone-clamped.
See also
A component is specified in one place, defined in another, and running in a third. All three, from here.
- System & states — the family specThe four-layer specification this component was built against, before it was written.Doc
- States, density and system componentsThe family running, with real figures in it, in both themes and at every density.Live
- CatalogAll 179 components, specified before they are written.Doc
Elsewhere in the system
Where Toast 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.
- Toast, runningThe system showcase — live, with theme, density, greyscale and reduced-motion switches.Live
- Writes, concurrency and rate limitsWhat happens when you write, and how fast can you go?API
- System & statesThe states that decide whether a product feels finished. Specs for 9 React components: EmptyState, ErrorState, Skeleton, StaleIndicator and 5 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 System & states 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.