Skip to main content

Inputs and validation

Start with one controlled input, then add one validation rule. Model keeps the current value and change intent connected.

Before you start: controlled inputs and component composition.

Component Input​

<ui:Theme xmlns:ui="urn:relo:registry:relo">
<Column state="{name:''}" class="p-4 gap-3">
<ui:Input label="Name" model="name" />
<Text bind-text="name" />
</Column>
</ui:Theme>
Component Input
editable
Browser preview
rReady to explore
Environment & events

Browser rendering of the shared document. Host services are bundled demo mocks. XML edits reset local state; data edits preserve compatible state.

Interact with the preview to inspect emitted events and mocked service calls.

Try it: change one value or variant, then reset and compare the result.

Input Validation​

<ui:Theme xmlns:ui="urn:relo:registry:relo">
<Column state="{name:''}" class="p-4 gap-3">
<ui:Input label="Name" model="name" bind-validationMessage="name == '' ? 'Enter your name' : null" />
</Column>
</ui:Theme>
Input Validation
editable
Browser preview
rReady to explore
Environment & events

Browser rendering of the shared document. Host services are bundled demo mocks. XML edits reset local state; data edits preserve compatible state.

Interact with the preview to inspect emitted events and mocked service calls.

Try it: change one value or variant, then reset and compare the result.

API​

input · field