DOCS
v0.4

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-workflowv0.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

PropTypeDefaultDescription
schemaFormSchemaJSON schema with fields, title, description
valuesRecord<string, unknown>Pre-filled values
loadingbooleanfalseShow loading state

Events

EventDetailDescription
ai-form-submit{values}Form submitted
ai-form-change{name, value, values}Field changed
ai-form-validate{valid, errors}Validation result