Rime

ImpactPreview

What a destructive action will change, row by row, before it is confirmed.

ImpactPreview lists the consequences of an action (projects reassigned, sign-ins revoked) with severities, named affected records, and loading, error and nothing-affected states. TypeToConfirmModal embeds it.

Installation

npx shadcn@latest add KezLahd/rime/impact-preview

Also installs: base, button, icon, skeleton, spinner.

Usage

import { ImpactPreview } from "@/components/ui";

<ImpactPreview items={[{ id: "a", severity: "destructive", title: "Signed out everywhere" }]} />

Examples

Default

Impact preview

This action cannot be undone

  • Irreversible: Jane Cooper is signed out everywhere

    Coming back needs a new invite.

  • No change: No open projects to reassign

API

Generated from the component's TypeScript types and JSDoc (scripts/gen-ui-registry.mjs), so it always matches the source.

ImpactPreview

ImpactPreview props
PropTypeDefaultDescription
titleReactNode"Impact preview"Default "Impact preview".
headingLevel2 | 3 | 43Level of the small-caps heading. 3 inside a modal (the dialog title is the h2).
statementReactNodeA compact danger line under the heading, e.g. "This action cannot be undone". TypeToConfirmModal passes its consequencesTitle here.
itemsImpactItem[]One row per consequence. Omit for a panel of prose only (children); an empty array renders the empty row ("Nothing else is affected").
childrenReactNodePlain text under the heading and above the rows: context the rows don't carry.
loadingbooleanfalseThe consequences are still being worked out on the server.
loadingRowsnumber3How many skeleton rows stand in while loading. Match the usual count.
errorReactNode | booleantrue for the default message, or the reason. Shown instead of the rows.
onRetry() => voidShows a Retry button in the error row.
emptyTitleReactNode"Nothing else is affected"Title of the row an empty items array renders.
affectedLimitnumber5Affected lists longer than this collapse behind "Show N more". Default 5.
classNamestring

Theme tokens

Per-component tokens are undeclared by default, so the default shown is the fallback the CSS uses. Set one at :root (or in theme.css) to restyle every instance. Live values are read from this page, so they follow the Rime Studio.

ImpactPreview per-component tokens
TokenDefaultLive value
--r-circle50%…

System tokens it reads

ImpactPreview system tokens
TokenDefaultLive value
--danger-filltokens.css…
--danger-inktokens.css…
--danger-solidtokens.css…
--easetokens.css…
--focus-ringtokens.css…
--font-bodytokens.css…
--ink-bodytokens.css…
--ink-brandtokens.css…
--ink-disabledtokens.css…
--ink-headingtokens.css…
--ink-mutedtokens.css…
--ink-secondarytokens.css…
--linetokens.css…
--line-softtokens.css…
--r-2xstokens.css…
--r-lgtokens.css…
--r-smtokens.css…
--r-xstokens.css…
--shadow-inputtokens.css…
--shadow-speculartokens.css…
--success-inktokens.css…
--success-solidtokens.css…
--surface-solidtokens.css…
--surface-sunkentokens.css…
--text-captiontokens.css…
--text-smalltokens.css…
--warning-filltokens.css…
--warning-inktokens.css…
--warning-solidtokens.css…
--wash-activetokens.css…

Accessibility

  • A list with a heading; severities are written out, not only coloured.

Do and don't

Do

  • State each row as an outcome: "3 projects are reassigned".

Don't

  • Don't hide consequences behind a disclosure.

For AI agents

This page as markdown, rendered from the same registry entry. Point an agent at it (or add .md to this page's URL), or at /llms.txt for the index.

Open impact-preview.md