AI Components / Form Generator
Form Generator
Dynamic form from AI-generated JSON schema. Renders inputs, selects, checkboxes with validation. LLM describes fields, component renders them.
ai-workflow v0.4.0
Playground
Examples
Feedback form
<ai-form-generator style="max-width:450px;"></ai-form-generator> Contact
<ai-form-generator style="max-width:450px;"></ai-form-generator> Loading
<ai-form-generator loading style="max-width:450px;"></ai-form-generator> Import
import { AiFormGenerator } from '@cognivo/components'; // Or tree-shake: import '@cognivo/components/ai-form-generator'; Per-component imports ship only that component (~8 kB gzip).
API Reference
| Prop | Type | Default | Description |
|---|---|---|---|
schema | FormSchema | — | JSON schema with fields, title, description |
values | Record<string, unknown> | — | Pre-filled values |
loading | boolean | false | Show loading state |
Events
| Event | Detail | Description |
|---|---|---|
ai-form-submit | {values} | Form submitted |
ai-form-change | {name, value, values} | Field changed |
ai-form-validate | {valid, errors} | Validation result |