Radiant layouts

The Radiant renderer ships its own shells and wizard blocks. These live previews use the same FormConfig JSON as the React renderer while rendering with Ecopages and Radiant UI elements.

Appearance in Radiant

The shells take the same named appearance as the React recipes: set view.shell.appearance (for example { size: 'comfortable', surface: 'elevated' } on the card shell) or a form-level appearance, and the shell reads the layout theme's semantic tokens (--se-space, --se-measure, --se-border-width, --se-shadow, --se-surface-background). Radiant elements emit the picked values as data-se-<axis> attributes, so a host axis is styled with CSS keyed on those attributes. The built-in card and card-wizard shells declare size and surface; the hero, split-screen and sidebar shells (and their wizard variants) declare size alone and read --se-space for their padding and gaps. The stack shell declares no axes, so an appearance on its shell slot is rejected, but it reads --se-space from the form's appearance (a step's pick does not reach a shell, which sits above the steps).

size also sets the height of inputs, selects, number fields and buttons: compact uses the --se-control-height-compact hook, which falls back to Radiant's --size-control-sm, and comfortable uses --se-control-height-comfortable, which falls back to --size-control-lg. No pick or default keeps the theme's --size-control-md. A field's font size follows --se-font-size, as it does in the React registry fields.

Two Radiant details matter when you tune it:

  • The size hooks (--se-space-compact, --se-control-height-compact and their comfortable twins) work from :root, any ancestor of the form or the form's own className, as in React; the nearest setting wins and it reaches a pick on the card shell, a step or a field. Each hook falls back to a --se-renderer-* property that Radiant sets on each form from its theme (set by renderers, not by apps), so a form with no hook follows its theme, also one scoped to a wrapper, and an app-wide hook outranks it.
  • Radiant UI computes --size-control-* on :root, so a scoped --rui-density does not resize controls below it. Theming has the wrapper rule.

Each form carries its own copy of the layout stylesheet: see Layout stylesheet per form. Layout lists which tool fits which job, and A themed form has a copy-paste config with its theme and CSS, rendered with these shells.

Wizard shell

The registration demo is a multi-step form with view: { $type: 'wizard' }, rendered with the canonical Radiant wizard shell and step navigation. The Registration wizard example has its files and tests.

Account

Developer
Designer
Product manager
Step 1 of 2

Its config:

const formConfig: FormConfig = {
	id: 'registration',
	title: 'Create your account',
	view: {
		$type: 'wizard'
	},
	steps: [
		{
			id: 'account',
			title: 'Account',
			elements: [
				{
					$type: 'input',
					id: 'email',
					name: 'email',
					label: 'Email',
					inputType: 'email',
					rules: [
						{
							$type: 'required',
							message: 'Enter your email'
						},
						{
							$type: 'email',
							message: 'Enter a valid email address'
						}
					]
				},
				{
					$type: 'input',
					id: 'password',
					name: 'password',
					label: 'Password',
					inputType: 'password',
					rules: [
						{
							$type: 'required',
							message: 'Choose a password'
						},
						{
							$type: 'minLength',
							value: 12,
							message: 'Use at least 12 characters'
						}
					]
				}
			]
		},
		{
			id: 'profile',
			title: 'Profile',
			elements: [
				{
					$type: 'input',
					id: 'name',
					name: 'name',
					label: 'Full name',
					rules: [
						{
							$type: 'required',
							message: 'Enter your name'
						}
					]
				},
				{
					$type: 'select',
					id: 'role',
					name: 'role',
					label: 'Role',
					placeholder: 'Choose your role',
					options: [
						{
							value: 'developer',
							label: 'Developer'
						},
						{
							value: 'designer',
							label: 'Designer'
						},
						{
							value: 'product',
							label: 'Product manager'
						}
					],
					rules: [
						{
							$type: 'required',
							message: 'Choose your role'
						}
					]
				}
			]
		}
	],
	actions: [
		{
			id: 'created',
			$type: 'show_notification',
			message: 'Account created. Welcome aboard.',
			variant: 'success',
			triggers: [
				'form_submit_success'
			]
		}
	]
};

Survey wizard

The survey demo uses the same wizard recipe, with a step that is skipped unless the answer was poor, and shows the Radiant field controls, including its select. The Branching survey example has its files and tests.

Your experience

Great
Fine
Poor
It took too long
It was not solved
The agent was unhelpful
Step 1 of 3

Its config:

const formConfig: FormConfig = {
	id: 'support-survey',
	title: 'How did we do?',
	view: {
		$type: 'wizard'
	},
	steps: [
		{
			id: 'experience',
			title: 'Your experience',
			elements: [
				{
					$type: 'input',
					id: 'name',
					name: 'name',
					label: 'Your name',
					rules: [
						{
							$type: 'required',
							message: 'Enter your name'
						}
					]
				},
				{
					$type: 'select',
					id: 'satisfaction',
					name: 'satisfaction',
					label: 'How was your support request?',
					placeholder: 'Choose one',
					options: [
						{
							value: 'great',
							label: 'Great'
						},
						{
							value: 'fine',
							label: 'Fine'
						},
						{
							value: 'poor',
							label: 'Poor'
						}
					],
					rules: [
						{
							$type: 'required',
							message: 'Choose one'
						}
					]
				}
			]
		},
		{
			id: 'problem',
			title: 'What went wrong',
			constraints: [
				{
					field: 'satisfaction',
					operator: 'equals',
					value: 'poor',
					$type: 'show'
				}
			],
			elements: [
				{
					$type: 'select',
					id: 'reason',
					name: 'reason',
					label: 'What was the main problem?',
					placeholder: 'Choose one',
					options: [
						{
							value: 'slow',
							label: 'It took too long'
						},
						{
							value: 'unresolved',
							label: 'It was not solved'
						},
						{
							value: 'rude',
							label: 'The agent was unhelpful'
						}
					],
					rules: [
						{
							$type: 'required',
							message: 'Choose the main problem'
						}
					]
				},
				{
					$type: 'textarea',
					id: 'details',
					name: 'details',
					label: 'Tell us what happened',
					rows: 4,
					rules: [
						{
							$type: 'minLength',
							value: 20,
							message: 'Use at least 20 characters'
						}
					]
				}
			]
		},
		{
			id: 'comments',
			title: 'Anything else?',
			elements: [
				{
					$type: 'textarea',
					id: 'comments',
					name: 'comments',
					label: 'Comments',
					rows: 4
				}
			]
		}
	],
	actions: [
		{
			id: 'thanks',
			$type: 'show_notification',
			message: 'Thanks for your answers.',
			variant: 'success',
			triggers: [
				'form_submit_success'
			]
		}
	]
};