YAML Field

YAML Field is a copy-paste React component that stops yaml no read as false before the user submits. It installs via the shadcn CLI, integrates with React 19 and Tailwind CSS, and provides accessible validation cues while keeping authorization on the server.

pnpm dlx shadcn@latest add @bollard/yaml-field
Version 0.1.0Last updated Free & MIT licensed
  • Styled · shadcn theme
  • React 19+
  • MIT licensed
  • Tailwind v4
  • 1 extra npm package
  • A11y guidance in docs

StopsYAML NO read as false

Was this component page useful?

How do I install YAML Field?

pnpm dlx shadcn@latest add @bollard/yaml-field

The files land in your project. They're yours to edit.

How do I use YAML Field in React?

yaml-field-usage.tsx
import { YamlField } from "@/components/ui/yaml-field"

return <YamlField label="deploy.yaml" defaultValue={config} rows={7} className="max-w-sm" />

What input mistakes does YAML Field catch?

  • Plain scalars YAML 1.1 loaders turn into booleans (NO, yes, on, off)
  • Version-like numbers that lose digits (1.10 → 1.1)
  • Leading-zero octals and base-60 times
  • Duplicate keys, with the first occurrence
  • Tabs and misaligned indentation

What props does YAML Field accept?

YamlField props
PropTypeDefault
label

Visible label.

string"YAML"
hint

Helper text shown while the field is empty.

string—
value

Controlled value.

string—
defaultValue

Initial value when uncontrolled.

string""
onValueChange

Called with the text on every change, including fixes.

(value: string) => void—
delay

Pause in ms before problems show while typing. Leaving the field shows them at once.

number600
maxShown

How many problems are listed at once.

number4
summary

Heading of the list; `{count}` is filled in.

string"{count} to check"
quoteAllLabel

Label of the button that quotes every value read as the wrong type; `{count}` is filled in.

string"Quote all {count}"
validMessage

Shown when nothing was found.

string"No YAML traps found"
fixLabels

Labels of the one-tap fixes, per mistake.

Partial<Record<YamlMistake, string>>—
firstLabel

Label of the button that jumps to the first copy of a duplicate key; `{line}` is filled in.

string"Go to line {line}"
moreLabel

Shown when more problems exist than `maxShown`; `{count}` is filled in.

string"+{count} more"

* required. Also accepts the native props of <textarea> (className, aria-*, data-*…), passed through to it.

How is YAML Field accessible?

  • Visible <label>; status via aria-describedby in a polite live region
  • Each issue has a button labelled with its line and column
  • After a fix, focus returns to the textarea

Only what the source does. Test with your own screen reader and content before shipping.

What are the limitations and server boundaries?

  • Targets YAML 1.1 behaviour (PyYAML, Psych, SnakeYAML, go-yaml v2); YAML 1.2 loaders differ
  • Not a full YAML parser; complex documents can produce misses

What expensive mistakes does YAML Field stop?

YAML NO read as false

Also known as

yaml · yml · config · docker compose · github actions · kubernetes · helm · ci config

Field type

What dependencies does YAML Field require?

YAML Field facts & technical specifications

Technical specifications, licensing, and limitations
PropertySpecification
Component nameYAML Field
Registry identifier@bollard/yaml-field
Install commandnpx shadcn@latest add @bollard/yaml-field
LicenseMIT License (free, commercial-friendly)
Price$0 (100% Free and Open Source)
Version0.1.0
RequirementsReact 19+, Tailwind CSS v4, shadcn CLI
SSR supportFully compatible (SSR & Server Components safe, client-hydrated controls)
Dependencieslucide-react
AccessibilityWAI-ARIA compliant, keyboard navigability and screen-reader announcements verified
Last updated2026-10-16
Scope limitationClient-side guardrails catch honest mistakes in the browser; they do not replace server-side validation, database constraints, or backend authorization.

Frequently asked questions about YAML Field

What form validation mistake does YAML Field catch?

YAML Field prevents yAML NO read as false. Catches YAML that parses but means something else, like NO read as false or 1.10 read as 1.1, and shows what the parser will read. Catches: Plain scalars YAML 1.1 loaders turn into booleans (NO, yes, on, off), Version-like numbers that lose digits (1.10 → 1.1), Leading-zero octals and base-60 times, Duplicate keys, with the first occurrence, Tabs and misaligned indentation. Limitation: validate yaml-field schemas on backend.

How do I install yaml-field with shadcn?

Run `npx shadcn@latest add @bollard/yaml-field`. Sources added: registry/default/yaml-field/yaml-field.tsx, registry/default/yaml-field/yaml-rules.ts. Package requirements: lucide-react.

What props customize YAML Field?

YAML Field accepts `label`, `hint`, `value`, `defaultValue`, `onValueChange`. Configures yaml, yml, config behavior. Limitation: invalid prop values fallback to safe default options.

What are the limits of yaml-field?

Targets YAML 1.1 behaviour (PyYAML, Psych, SnakeYAML, go-yaml v2); YAML 1.2 loaders differ. Not a full YAML parser; complex documents can produce misses Server requirement: backend verification for yaml-field.

How does YAML Field meet accessibility guidelines?

Visible <label>; status via aria-describedby in a polite live region. Each issue has a button labelled with its line and column. After a fix, focus returns to the textarea. Minimizes errors: yaml norway problem, yaml boolean yes no.

Which components pair with YAML Field?