Form
A dynamic form builder component that creates structured forms with multiple input types, validation, and flexible layouts. Perfect for generating contact forms, surveys, and data collection interfaces.
Examples
Contact Form
Tambo Conversations
Loading threads...
Installation
Component API
Form
| Prop | Type | Default | Description |
|---|---|---|---|
| title | string | - | Form heading displayed at the top |
| description | string | - | Optional description text below the title |
| fields | FormField[] | - | Array of form field configurations |
| variant | "solid" | "bordered" | "solid" | Visual style of the form container |
| layout | "compact" | "relaxed" | "compact" | Spacing between form fields |
| onSubmit | (data: Record<string, any>) => void | - | Callback function when form is submitted |
| className | string | - | Additional CSS classes for customization |
FormField
| Prop | Type | Default | Description |
|---|---|---|---|
| name | string | - | Unique identifier for the field |
| label | string | - | Label text displayed above the field |
| type | "text" | "email" | "number" | "textarea" | "select" | "text" | Type of input field to render |
| required | boolean | false | Whether the field is required |
| placeholder | string | - | Placeholder text shown in empty fields |
| description | string | - | Helper text displayed below the field |
| options | string[] | - | Options for select fields |