Control Type Inference
Understand how NeoArc infers the appropriate UI control type from data shapes. Learn about the available control types and how to override the automatic selection.
When you bind a UI control to a field, NeoArc examines the field's data type, constraints, and metadata to infer the most appropriate control type. This saves you from manually choosing a control for every field, while still allowing overrides when the automatic choice is not ideal.
How Inference Works
The inference engine evaluates several factors in order of priority:
Control Types
| Control | Inferred When | Example Fields |
|---|---|---|
| Text Input | String without specialisation | name, title, description |
| Text Area | String with maxLength > 256 or multiline hint | bio, notes, comments |
| Number Input | Integer or number type | age, quantity, price |
| Toggle | Boolean type | isActive, isPublished |
| Checkbox | Boolean with explicit checkbox hint | agreeToTerms |
| Date Picker | String with date specialisation | birthDate, startDate |
| Date-Time Picker | String with date-time specialisation | createdAt, scheduledAt |
| Email Input | String with email specialisation | email, contactEmail |
| URL Input | String with uri specialisation | website, profileUrl |
| Dropdown | Enum type or string with few allowed values | status, category, role |
| Radio Group | Enum with 4 or fewer options | priority, size |
| Multi-Select | Array of enum values | tags, permissions |
| Table | Array of objects | items, addresses, contacts |
| Rich Text Editor | String with rich-text hint | content, body |
| File Upload | String with binary or file specialisation | avatar, attachment |
Overriding the Inferred Type
You can override the inferred control type at any time: