A dynamic form component that can be generated from schema definitions, optimized for LLM generation.
Use the Agent Form pattern when you need to:
- Create forms dynamically from data
- Generate forms via LLM instructions
- Build multi-step or conditional forms
- Collect user input in agent interfaces
| Prop | Type | Required | Description |
|---|---|---|---|
title |
string |
No | Form title |
description |
string |
No | Form description |
fields |
FormField[] |
Yes | Array of field definitions |
onSubmit |
function |
No | Submit callback |
submitLabel |
string |
No | Submit button label |
text- Text inputemail- Email inputnumber- Number inputtextarea- Multi-line textselect- Dropdown selectcheckbox- Checkbox input
import { agentFormSchema } from "./schema"
const data = agentFormSchema.parse({
title: "Contact Form",
fields: [
{
name: "email",
label: "Email",
type: "email",
required: true
}
]
})import { AgentForm } from "./component"
<AgentForm
title="Contact Form"
fields={[
{ name: "name", label: "Name", type: "text", required: true }
]}
onSubmit={(data) => console.log(data)}
/>useRenderToolCall({
toolName: "render_agent_form",
argumentsSchema: agentFormSchema,
render: (props) => <AgentForm {...props} />
})The Agent Form component includes full accessibility support:
- Label associations - All inputs have associated
<label>elements withhtmlFor - Required fields - Required fields include
aria-required="true"and visual indicators - Screen reader support - Required indicators include screen reader text
- Focus management - Proper focus states and keyboard navigation
- Form semantics - Uses semantic
<form>element with proper structure
✅ rams.ai - Accessible form structure with proper labels and ARIA attributes
✅ ui-skills.com - Schema-driven, LLM-generatable component
✅ Vercel Guidelines - Theme-compatible, responsive design