Xzero UI
Pro library

Smart form fillPro

A paste-to-fill form card where AI reads an email signature or messy notes and fills a contact field by field. Each value flashes in with a confidence dot, its source lights up in the pasted text, low-confidence guesses ask for review, and Undo puts the old values back.

$ pnpm dlx shadcn@4.23.0 add @xzero-ui-pro/smart-form-fill
Live · keyboard ready

When to use

When not to use

Installation

Register both Xzero UI namespaces in your project's components.json:

{
  "registries": {
    "@xzero-ui": "https://mcp.xzero.co.uk/r/{name}.json",
    "@xzero-ui-pro": "https://mcp.xzero.co.uk/r/pro/{name}.json"
  }
}
npx shadcn@4.23.0 add @xzero-ui-pro/smart-form-fill

Install xzero-foundation once, and import @/components/xzero/foundation.css in your app root. No Xzero token is used by this snapshot. For sample portraits, photos, fonts, or logos, download https://mcp.xzero.co.uk/install-assets.mjs and run node xzero-install-assets.mjs <receiving-project>.

Usage

import { SmartFormFill } from "@/components/xzero/smart-form-fill/smart-form-fill";

export function NewContact() {
  return (
    <SmartFormFill
      extract={async (text, signal) => {
        const response = await fetch("/api/extract-contact", { method: "POST", body: text, signal });
        return response.json(); // { name: { value, confidence, source }, ... }
      }}
      onSubmit={(values) => saveContact(values)}
    />
  );
}

API reference

SmartFormFill

A form card with a paste area. Pasted text is read by AI, each field fills in turn with a short highlight and a confidence dot, low-confidence fields ask for review, and Undo restores the values from before the fill.

PropTypeDefaultDescription
fieldsSmartFormFillField[]contact fieldsThe form: { id, label, kind?, placeholder?, span?, autoComplete? }. kind picks the input type; "company" adds a logo slot. Defaults to name, title, company, email, phone and address.
defaultValuesRecord<string, string>–Starting values keyed by field id.
onValuesChange(values: Record<string, string>) => void–Called on every change, typed or filled.
extract(text: string, signal: AbortSignal) => Promise<SmartFormFillResult>simulateExtractReads the pasted text and resolves { [fieldId]: { value, confidence, source?, note? } }. Abort when the signal fires (Stop, Escape, a new paste). Defaults to a simulated read: hand-checked results for the samples and a local parser for anything else.
reviewThresholdnumber0.8Fields with a confidence below this ask for review and block Save until checked or edited.
samples{ label: string; text: string }[]signature and messy noteTexts behind Try sample, cycled in order. Pass [] to hide the button and the autoplay.
autoPlaybooleantrue without extractLoops paste, fill, review and undo while visible, and stops for good on the first pointer or key press inside the card.
onFill(result: SmartFormFillResult) => void–Called once every field from a read has been filled.
onUndo(restored: Record<string, string>) => void–Called after Undo restores the values from before the last fill.
onSubmit(values: Record<string, string>) => void | Promise<void>–Saves the form. The button shows a loading state while the promise is pending; a rejection shows an error status. Defaults to a simulated save.
resolveLogo(company: string) => ReactNode | undefined–Logo for the company field. Falls back to built-in marks for Stripe, Linear, Vercel, Figma and Notion, then a building icon.
model{ name: string; mark?: ReactNode }Claude Haiku 5.5The model named beside the paste area.
titlestring"New contact"Card title.
descriptionstring–One line under the title. Pass an empty string to hide it.
submitLabelstring"Save contact"Label of the primary action.
classNamestring–Class on the root card.

Keyboard interactions

KeysAction
Cmd/Ctrl + VPaste into the text area; the read starts right away.
Cmd/Ctrl + EnterRead typed text from the text area.
EscapeStop a read in progress; nothing changes.
TabMoves through the text area, Try sample, Fill, every field, the check buttons, Undo and Save.

Accessibility

Motion

Responsive behavior

Performance

Notes for AI

Also in ai

Guidance for AI tools

Smart form fill: A paste-to-fill form card where AI reads an email signature or messy notes and fills a contact field by field. Each value flashes in with a confidence dot, its source lights up in the pasted text, low-confidence guesses ask for review, and Undo puts the old values back. Follow the declared prop types and do not invent props. Keep keyboard access, reduced motion support, and both light and dark themes intact when adapting it.

Full library index: https://ui.xzero.co.uk/llms.txt

Browse all components