Contact Form
These previews use Radiant because the docs app is Ecopages + Radiant UI.
This example combines shared element configuration with conditional behavior.
Each field sits on its own line. Form-level title and description feed the
card header together with the step title (required on every step).
Interactive demo
Configuration reference
const formConfig: FormConfig = {
id: 'contact',
title: 'Contact us',
description: 'Send a message with conditional fields.',
steps: [
{
id: 'details',
title: 'Contact us',
elements: [
{
$type: 'select',
id: 'subject',
name: 'subject',
label: 'Subject',
options: [
{
value: 'general',
label: 'General question'
},
{
value: 'support',
label: 'Technical support'
}
],
rules: [
{
type: 'required',
message: 'Subject is required'
}
]
},
{
$type: 'input',
id: 'ticket',
name: 'ticket',
label: 'Support ticket number',
constraints: [
{
field: 'subject',
operator: 'equals',
value: 'support',
action: 'show'
}
],
rules: [
{
type: 'required',
message: 'Support ticket number is required'
}
]
},
{
$type: 'textarea',
id: 'message',
name: 'message',
label: 'Message',
rules: [
{
type: 'required',
message: 'Message is required'
}
]
}
]
}
],
view: {
$type: 'card',
shell: {
appearance: {
size: 'default',
surface: 'elevated'
}
},
header: {
align: 'center',
size: 'md'
}
}
};constraints are direct objects on the element. The field's visibility is
derived from the current form value; it is not a separate layout or step
configuration.
The same configuration renders in React: React Forms.
See constraint logic, validation, and components for the underlying contracts.