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
rReady to explore
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
rReady to explore
Try it: change one value or variant, then reset and compare the result.