Overview
Reference usage
Single-line text input with support for labels, addons, validation states, and helper text.
On touch, the field is at least 44px tall. With an addon, tapping the top or bottom border over the text field focuses the input.
Usage
Filled appearance
appearance="filled" draws an inset fill inside the same 1px --cinder-control-border edge, a 12px radius and the 2px focus ring. The edge is what keeps the 3:1 boundary: the fill alone measures about 1.1:1 against its surface and would fail WCAG 1.4.11. Hover darkens the edge, focus lifts the fill to the control surface under the ring, an invalid field keeps its danger edge, and a disabled field drops to the disabled fill. A read-only value drops the fill and keeps its dashed edge, so an editable field and a read-only value stay apart. Under data-density="comfortable" a field with no appearance is filled and 48px tall; the default density stays outlined, and appearance="outlined" opts a field out. The same prop is on Select, Textarea and SearchField.
When to use
- Collecting a single line of free-form text such as a name, email, or URL.
- Composing inside a form-field with leading or trailing adornments while keeping the input at least 44px tall on touch.
- Collecting multi-line prose — use textarea instead.
- Collecting a numeric value with stepping controls — use number-input instead.
Examples
Basic input
Text input with label and bound value.
Code variant
variant="code" applies a shared monospace metric set for source-like values such as regular expressions, URIs, or identifiers.
Editable title
variant="bare" is text that looks like a 600-weight title and is edited in place: no border at rest, a hover tint, and the control fill under the focus ring.
Sign-in composition
Composition of FormField + Input + Button with a top-of-form Alert auth-error region. Demonstrates the required autocomplete values and the assertive announcement pattern via role="alert".
Input types
Text, email, password, search, date, tel, and url types.
Input with error
Error message wired via aria-invalid and aria-describedby.
Props
Name | Type | Default | Description |
|---|---|---|---|
id required | text | HTML id for the underlying input, used to associate the <label> and ARIA attributes. Required. | |
value bindable | text | '' | Bindable current text value of the input. |
onValueChangeRequest | (next: string) => stringvoid | Intercept a proposed value before the bindable value is written. Return a replacement value to transform it. | |
onValueChange | (next: string) => void | Notify after the bindable value has been committed. | |
label | text | Visible label text rendered above the input and linked via for/id. | |
labelVisible | boolean | true | Whether the label is visibly rendered. Set false to visually hide
it while keeping it programmatically associated. |
description | text | Helper text rendered below the input and associated via aria-describedby. | |
descriptionAction | snippet | Rendered after the helper text inside the same paragraph, so it joins aria-describedby: a quiet link such as "Where do I get one?". Shown only with description. | |
error | text | Error message rendered below the input; also sets aria-invalid on the input. | |
disabled | boolean | When true, disables the input, matching the native disabled attribute. | |
required | boolean | Marks the input as required for form validation, matching the native required attribute. | |
optional | boolean | false | Appends "Optional" to the visible label. Do not combine with required; required wins. |
type | 'text''email''password''search''tel''time''url''date' 1 more members'number' | 'text' | Input type controlling the browser's built-in validation and keyboard. Default "text". |
variant | 'default' | 'code' | 'bare' | 'default' | Visual style. "code" applies a shared monospace metric set (font-family, font-size,
line-height, tab-size) for source-like values such as regular expressions, URIs, or
identifiers. "bare" is an editable title: text that looks like a 600-weight title, with
no border at rest, a hover tint, a focus ring over the control fill, and a width that
follows its content. |
appearance | 'outlined' | 'filled' | undefined | How the field is drawn. "outlined" is the control fill inside a 1px edge. "filled" is an
inset fill inside the same 1px --cinder-control-border edge, which keeps the 3:1 boundary
the fill alone would lose, with a 12px radius, a 48px height in the comfortable density and
the 2px focus ring. Left unset, the field follows its density: filled under
data-density="comfortable", outlined otherwise. | |
quietBorder | boolean | false | Uses Cinder's opt-in quiet resting boundary for an outlined control in a dense settings surface. It remains at least 3:1 against both adjacent surfaces; hover, focus, invalid, disabled, and high-contrast states keep their standard treatments. |
size | 'sm' | 'md' | 'lg' | 'md' | Height step from the shared --cinder-control-height-* scale: sm 28px, md 32px,
lg 40px, the same heights as a Button of that size. Replaces the native character-width
size attribute, which Cinder does not forward; set a width with CSS instead. |
inputAttachment | Attachment<HTMLInputElement> | Attachment for native input access and lifecycle-scoped listeners. | |
groupClassName | text | Additional class names applied to the grouped control frame when leading or trailing content is present. | |
leading | snippet | ||
trailing | snippet | ||
leadingInteractive | boolean | false | When true, the leading adornment is interactive and included in the accessibility tree. Default false. |
trailingInteractive | boolean | false | When true, the trailing adornment is interactive and included in the accessibility tree. Default false. |
oninput | FormEventHandler<T> | undefined | null |