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.
| Prop | Type | Notes |
|---|---|---|
resultrequired | StructuredOutputResult | Your own validation result, or `validateOutput(raw, schema)` from this file. |
schema | SchemaField[] | 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. |
isCorrecting | boolean | A correction is being made, if you track it yourself. |
correction | StructuredOutputResult | The corrected output, once you have it: shown beside the original. |
Dependencies
npm packages
Does not match the
schemaclsxframer-motionlucide-reacttailwind-mergeLayro foundations, installed alongside it
layro-themebadgebuttonsegmented-controltabsLifetime 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 componentsEvidence Map
PaidClaims and sources joined by what supports, contradicts or only gives context.
Included with lifetime access
Data Lineage
PaidWhere an AI output came from, and which upstream data is stale or missing.
Included with lifetime access
Retrieval Inspector
PaidWhat the retriever found for a question, and which chunks reached the model.
Included with lifetime access
Citation Verification
PaidEach claim in an answer beside the evidence, with a verdict a person can set.
Included with lifetime access
Ingestion Pipeline
PaidFiles going into a knowledge base, each with its own chain of steps.
Included with lifetime access
Prompt Test Matrix
PaidA prompt against its test cases: expected, actual, and what regressed.
Included with lifetime access