Resolved field

Resolved field is a neobrutalist React component from Cruise UI. Shows the result of a lookup under its input, e.g. the account name for an account number: "Resolving…" with a spinner, then the value or an error with Try again. Install it with npx shadcn@latest add @cruiseui/cruise-resolved-field.

Install

Terminal

npx shadcn@latest add @cruiseui/cruise-resolved-field

First time? Installation shows the one-off components.json setup (the @cruiseui registry) and how to turn the theme on.

Example

Corners

Try 0123456789 (found) or 9876543210 (not found).

Account name
Enter the account number to see the name.

When to use it

When to use

Account-name lookups in transfers, business-name checks, any value fetched from what someone typed.

When not to

Validating the input's own format (use the field's error).

Props

CruiseResolvedField

PropTypeDefaultDescription
label?string"Account name"What the value is, shown above it.
statusCruiseResolveStatus——
value?ReactNode—The resolved value, e.g. "ADA OKAFOR".
error?ReactNode"We couldn't find that account. Check the number and bank."Shown when status is "error".
placeholder?ReactNode"Enter the account number to see the name."Shown before a lookup starts (status "idle").
resolvingText?ReactNode"Resolving…"—
onRetry?(() => void)—Adds a "Try again" button to the error.
className?string——

Usage

  • Keep the status in your component: set status to "resolving" when the account number and bank are complete, then "resolved" with the name or "error".
  • Debounce the lookup (about 400ms) and ignore answers that arrive after the input changed.

Accessibility

  • role="status" with aria-live="polite": each change is read out.
  • Resolved and error states use an icon and words, not colour alone.
  • "Try again" is a real button.