Launch priceOne payment

Output Validator

Structured output as a tree with every problem pinned to its field, a list of issues with the path, expected type and actual value, and the raw text a tab away. Output that did not parse is labelled as such, with the failing line marked, and a correction you request can be compared with the original.

Ready for AI tools one file typed props installs by name prompt included

The decision inside it

Not valid JSON and not valid against the schema are different

A parse error shows the raw text and never a pretend tree; a schema error shows the parsed tree with the wrong fields marked.

Installation

How you get it

Paste this into Claude Code, Cursor, Codex or any coding agent. It installs the file and uses it as it is, instead of writing a new one.

Use Layro's Output Validator for this.
Install it: npx shadcn@latest add @layro/output-validator
Import it from @/components/ui/output-validator.
Do not rewrite or restyle it. Pass my data through its props
and keep its built-in states.

For the full brief with every prop and the mistakes assistants usually make, use Copy prompt above. Pro components install through the @layro registry with your CLI token: see the Namespaced tab.

API

“Copy prompt” above puts a full brief on your clipboard — install command, dependencies, props, and the mistakes an assistant usually makes with this component.

Props

Read from the component’s own TypeScript interface when the site is built, so this table cannot drift from the file you install.

PropTypeNotes
resultrequiredStructuredOutputResultYour own validation result, or `validateOutput(raw, schema)` from this file.
schemaSchemaField[]The fields the output should have, for the schema summary.
onIssueSelect(issue: ValidationIssue) => void—
onCopyRaw() => void—
onCopyFormatted() => void—
onRequestCorrection() => void | Promise<void>Adds "Ask for a correction". May return a promise.
isCorrectingbooleanA correction is being made, if you track it yourself.
correctionStructuredOutputResultThe corrected output, once you have it: shown beside the original.

Dependencies

npm packages

Does not match the schemaclsxframer-motionlucide-reacttailwind-merge

Layro foundations, installed alongside it

layro-themebadgebuttonsegmented-controltabs

Lifetime access

Every component, and everything we ship next.

  • All 112 components, source included
  • The template, and everything released after you buy
  • shadcn CLI or download — React 18/19, Tailwind v4
  • One payment. No subscription.

More in RAG & Evals

All RAG & Evals components