InfoTip
- Status
- Implemented
- Family
- 1 of 13
- Registry
- @lopifi/info-tip
npx shadcn@latest add @lopifi/theme @lopifi/info-tipThe component, rendering
Real data, the shipped component. Switch the theme to check the claims the spec makes below.
The four-layer spec
The ⓘ. Additional context, reachable on every input.
<InfoTip about="Why this account needs reconnecting" label="This balance may be out of date">
Mercury revoked this connection's authorization. Last synced 21 Sep 2026, 09:12 UTC.
</InfoTip>
interface InfoTipProps {
/** An optional bolded first line. A term; omit it for a plain sentence. */
label?: React.ReactNode;
children: React.ReactNode;
/** The affordance's accessible name — "About available balance". */
about: string;
side?: "top" | "bottom" | "left" | "right";
align?: "start" | "center" | "end";
/** Replaces the ⓘ glyph — a warning triangle beside a broken state, say. */
trigger?: React.ReactNode;
}
A Popover, not a Tooltip, and that is the entire design. It opens on hover on a fine pointer,
on press everywhere, and on focus from the keyboard — so the sentence inside it is reachable on a
phone, which is what licenses putting a real sentence there at all. Escape and an outside press
close it. 16px glyph, 40px hit area, --text-tertiary at rest.
Use it to shorten an alert. "Reauthorization required — this balance may be out of date" in a
one-third-width card wraps to three lines and reads as a paragraph in a strip meant to read as a
state. "Reauthorization required" plus an ⓘ says the same thing in one line, and the explanation
is one press away instead of permanently in the way.
Never put an action, a link the user must follow, or the only copy of a number inside one.
Lifted verbatim from Primitives. 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/info-tip.tsx
- Lopifi dependencies · 3
- cniconstooltip
- npm packages
- @base-ui-components/reactclsxtailwind-merge
- Registry entry
- /r/info-tip.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 { Popover } from "@base-ui-components/react/popover";
import type * as React from "react";
import { cn } from "@/lib/ledger/cn";
import { InformationCircleIcon } from "@/components/ledger/icons";
import {
TOOLTIP_DELAY,
TOOLTIP_MOTION,
TOOLTIP_SURFACE,
type TooltipAlign,
type TooltipSide,
} from "@/components/ledger/tooltip";
export interface InfoTipProps {
/** Names the affordance for screen readers: "About available balance". */
about: string;
align?: TooltipAlign;
children: React.ReactNode;
className?: string;
/** An optional bolded first line. Use for a term; omit for a plain sentence. */
label?: React.ReactNode;
side?: TooltipSide;
/** Replaces the ⓘ glyph — e.g. a warning triangle beside a broken state. */
trigger?: React.ReactNode;
triggerClassName?: string;
}
/**
* The ⓘ. A Popover rather than a Tooltip because it opens on press, and a
* 16px glyph carrying a 40px hit area because it is a target on a phone.
*/
export function InfoTip({
label,
children,
about,
side = "top",
align = "center",
trigger,
className,
triggerClassName,
}: InfoTipProps) {
return (
<Popover.Root>
<Popover.Trigger
aria-label={about}
className={cn(
"relative inline-grid size-4 shrink-0 place-items-center rounded-full align-[-2px]",
"text-text-tertiary transition-colors duration-1 ease-standard",
"after:absolute after:inset-[-12px] after:content-['']",
"focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[var(--accent)]",
"hover:text-text-secondary",
"data-[popup-open]:text-text-secondary",
triggerClassName,
)}
delay={TOOLTIP_DELAY}
openOnHover
>
{trigger ?? <InformationCircleIcon aria-hidden="true" className="size-4" />}
</Popover.Trigger>
<Popover.Portal>
<Popover.Positioner align={align} className="z-tooltip" side={side} sideOffset={8}>
<Popover.Popup className={cn(TOOLTIP_SURFACE, TOOLTIP_MOTION, "outline-none", className)}>
{label ? <p className="mb-1 font-medium text-text-primary">{label}</p> : null}
<div className="text-text-secondary">{children}</div>
</Popover.Popup>
</Popover.Positioner>
</Popover.Portal>
</Popover.Root>
);
}
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 Primitives
- MoneyThe core primitive. A monetary value, formatted correctly.
- DeltaA signed change, with polarity and a redundant non-color cue.
- FigureA large display numeral with automatic size step-down.
- PercentPercent vs. percentage points, explicitly discriminated.
- RuleSingle / double / section accounting rule lines.
- StatusPillPayment and reconciliation states.
- SparklineInline trend, one-shot draw.
- TrendArrow + delta + optional sparkline, composed.
- AsOfTimestamp with live relative formatting and a stated timezone.
- RedactedMasked value with reveal.
- ReferenceCopyable transaction/account ID with disambiguated glyphs.
- CurrencyBadgeISO code + optional flag.
- EntityMarkBank/merchant logo with the full fallback ladder.
- TooltipHover/focus restatement. Never the only home of a fact.
See also
A component is specified in one place, defined in another, and running in a third. All three, from here.
- Primitives — the family specThe four-layer specification this component was built against, before it was written.Doc
- Money and figure primitivesThe family running, with real figures in it, in both themes and at every density.Live
- CatalogAll 179 components, specified before they are written.Doc
- Available balanceSpendable nowTerm
Elsewhere in the system
Where InfoTip 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 Primitives 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.