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

$
npx tambo add form

Component API

Form

PropTypeDefaultDescription
titlestring-Form heading displayed at the top
descriptionstring-Optional description text below the title
fieldsFormField[]-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
classNamestring-Additional CSS classes for customization

FormField

PropTypeDefaultDescription
namestring-Unique identifier for the field
labelstring-Label text displayed above the field
type"text" | "email" | "number" | "textarea" | "select""text"Type of input field to render
requiredbooleanfalseWhether the field is required
placeholderstring-Placeholder text shown in empty fields
descriptionstring-Helper text displayed below the field
optionsstring[]-Options for select fields