Components
Fields, selects and textareas
Make editorial inputs understandable before entry and recoverable after errors.
On this page
Purpose and placement
Make editorial inputs understandable before entry and recoverable after errors.
Anatomy
| Part | Behavior |
|---|---|
| AdminField | Wrapping label, optional description and child control. |
| Input/select | Native input or select with source border, background and focus style. |
| Textarea | Multi-line copy entry with deliberate row count. |
Configuration and contract
| Input or decision | Implementation |
|---|---|
| AdminField | label, description and children. |
| Native props | name, defaultValue/value, required, disabled, readOnly and input type remain caller responsibilities. |
| Validation | The primitive does not supply a domain validation/error association framework. |
States and feedback
- Editable input/select/textarea, read-only and disabled captures.
- Focused input capture shows native focus styling.
- Invalid and server errors require an explicit caller contract.
Usage rules
- Use a visible label; placeholders cannot replace it.
- Use descriptions for editorial guidance, not field names.
- Keep invalid values so editors can correct them.
- Choose disabled for unavailable editing and readOnly for inspectable values; they behave differently during form submission.
Accessibility and verification
The wrapped label helps name the input, but descriptions and errors need programmatic association where relevant. Review required, invalid and busy semantics rather than inferring them from color.
Composition example
<AdminField label="Story title" description="Keep the local context clear.">
<AdminInput name="title" defaultValue={story.title} required />
</AdminField>Source references
| File | Responsibility |
|---|---|
| components/admin-ui.tsx | Audited Townwell implementation; use this file when extending this interface. |
| components/admin/story-editor-form.tsx | Audited Townwell implementation; use this file when extending this interface. |
Examples from the app
Actual Boise Today and Townwell UI with synthetic editorial, business, review, media metadata and analytics. Existing Boise imagery; no live data changes. Captured at 2× resolution or higher. Select an image to inspect it full size.
Related topics
Source audit: 2026-10-07 · Revision ce8bc72b96da · Documentation v0.1