eQuantic.UIeQuantic.UI
Docs
Playground
GitHub
DocsActions & inputs
TextInput
View source
2 min read
Single-line entry in a stateful container: label above, bordered box, optional leading glyph, and a helper/error line that is always reserved so an error never shifts the form.
1
using eQuantic.UI.Components;
STATES
Label
default · 1dp BorderStrong
Label
Enter a valid address
Enter a valid address
error · Destructive
Label
disabled · SurfaceSubtle
Usage
1
2
3
4
5
6
new TextInput(_email, v => SetState(() => _email = v),
label: "Work email",
placeholder: "you@company.com",
error: _emailError,
leading: Icons.Mail,
size: SizeVariant.Large)
API
Prop
Type
Default
Description
Value
string
Controlled value; the component never owns the text.
OnChanged
Action<string>?
null
Fires per accepted keystroke.
Label
string
""
Persistent label above the field, TypeRole.Label, 6 dp gap.
Placeholder
string?
null
Hint inside the empty field, in TextMuted.
Helper
string?
null
Guidance under the field; Error replaces it.
Error
string?
null
Non-null switches the container and caption to Destructive. Validation is the app's call — on blur or submit, never per keystroke on first entry.
Leading
Icons?
null
20 dp leading glyph (IconSize.Dense).
Size
SizeVariant
Large
Small throws — text plus padding cannot fit 32 dp.
Disabled
bool
false
Paints the SurfaceSubtle fill.
Autofocus
bool
false
Claims the caret the first time it appears. Honoured once.
Obscure
bool
false
Password entry.
States
State
Rendering
Default
1 dp BorderStrong on Surface
Focused
2 dp Primary border; horizontal padding compensates −1 dp so nothing shifts
Error
Destructive border, kept through focus; caption carries the message
Disabled
SurfaceSubtle fill
Accessibility
Role textbox named by Label, described by Helper.
The error message is announced when it appears; the reserved caption line means layout never jumps.
Focus is internal state fed by the entry's focus callbacks — the positional reconciler keeps the instance across controlled re-renders.
When to use
One field per fact you need. Label every field.
Validate on blur or submit.
Avoid
Placeholder as the only label.
SizeVariant.Small — the constructor rejects it.
WARNINGv1 fences: keyboard hints and the trailing slot (clear / reveal / counter) land with IME at M4.
NOTEEvery dimension resolves through Sizing.*(SizeVariant) and the token scales — never a literal. Source: src/eQuantic.UI.Components/TextInput.cs.