Form layout parts: field sets, groups, labels, descriptions, ASCII separators and errors.
Install
Add it to your project
Run this in a project set up for shadcn/ui. It writes the files and installs the npm packages.
First time: connect the Infinity UI registry
- Create a personal token on your Tokens page.
- Put it in
.env.localasINFINITYUI_TOKEN. - Add the registry to
components.json:
{
"registries": {
"@infinityui": {
"url": "https://infinityui.io/r/{name}.json",
"headers": {
"Authorization": "Bearer ${INFINITYUI_TOKEN}"
}
}
}
}Using Claude Code, Codex, Cursor, Lovable or v0? See CLI & MCP for a setup prompt.
Code
"use client";
import { Checkbox } from "@/registry/ui/checkbox";
import { Field, FieldDescription, FieldError, FieldGroup, FieldLabel, FieldLegend, FieldSeparator, FieldSet } from "@/registry/ui/field";
import { Input } from "@/registry/ui/input";
export default function FieldDemo() {
return (
<FieldSet style={{ maxWidth: 380 }}>
<FieldLegend>Profile</FieldLegend>
<FieldGroup>
<Field>
<FieldLabel htmlFor="field-name">Name</FieldLabel>
<Input id="field-name" placeholder="Ada Lovelace" />
<FieldDescription>Shown on your profile.</FieldDescription>
</Field>
<Field>
<FieldLabel htmlFor="field-handle">Handle</FieldLabel>
<Input id="field-handle" defaultValue="ada!" aria-invalid />
<FieldError errors={[{ message: "Letters, numbers and dashes only." }]} />
</Field>
<FieldSeparator>or</FieldSeparator>
<Field orientation="horizontal">
<Checkbox id="field-anon" />
<FieldLabel htmlFor="field-anon">Stay anonymous</FieldLabel>
</Field>
</FieldGroup>
</FieldSet>
);
}
































