Skip to content

value

value marks the text element standing in for a control’s value in the design. A designed text input is a stack of styled layers — a value text node, a placeholder text node, decorations, wrappers — where a native control is one element with attributes. Collapse replaces the stack, driven by annotation rather than discovery: without value the transform would have to guess which text node is the value.

Status — React: Implemented • Web Components: Implemented • iOS: Not yet planned • Android: Not yet planned

The name is specs-native. ARIA has no vocabulary for pieces of a component, so the part vocabulary supplies one.

Roles

Apply the following roles to elements:

RoleTypeElement
valuePartElement of type: text
placeholderPartElement of type: text
WhereWhat is emitted
The value elementConsumed — its text seeds the control’s value; the element does not render
The placeholder elementConsumed into the control’s placeholder attribute
The resolved controlRenders with that value; its own contract carries the change signal

Specs

Component anatomy typically has elements and roles like:

anatomy:
field:
type: container
role: textbox
value:
type: text
role: value
placeholder:
type: text
role: placeholder

Figma

Annotate the following layers:

  • the value text layer as role:value
  • the placeholder text layer as role:placeholder

Land the control’s role on the container holding only these layers. Anything else inside is dropped.

React

Implementation

Nothing. value is a declaration the component acts on for itself; consumers address the control’s value prop.

Before / After

// before
<div className="input-field">
<div className="input-value">{p.value}</div>
<div className="input-placeholder">{p.placeholder}</div>
</div>
// after
<input
className="input-field"
value={value}
placeholder={p.placeholder}
onChange={handleChange}
/>

Contract

None. value tells the control where its value lives; the control’s own role carries the event surface. Its onChange fires on every keystroke for the text family, or on drag and arrow keys for slider.

The only parts carrying handlers sit beside value on a spinbutton: increment and decrement emit real buttons whose onClick calls stepUp() / stepDown() on the control. Both delegate rather than owning behavior.

Web Components

Identical consumption. One difference: on textarea the value is element content rather than an attribute, so the emitted element takes a property binding and renders no value="" attribute when empty.

iOS

Not yet planned. Intended binding:

EmitsThe text field’s bound value
placeholderThe TextField prompt

Android

Not yet planned. Intended binding:

EmitsThe text field state’s value
placeholderThe placeholder slot

Additional details

What happens to everything else

Unannotated descendants of a collapsing control do not render — the author declared what mattered by annotating it.

DescendantResult
Bare wrapperDropped silently
Text, glyph, image, or composed instanceDropped, named in a warning
A slotDropped, named in a warning
A non-part roleDropped, named in a warning

Chrome that should keep rendering — icons, affordance buttons — belongs beside the collapsing container, not inside it.

Resolution

  • Accepted only by value-bearing concepts (textbox, password, searchbox, spinbutton, slider, textarea), so it resolves to the component’s single value-bearing control wherever either sits. No tree walk, no ambiguity.
  • At most one element per part per control. Two elements claiming value is an error naming both.
  • A value with no candidate control is valid and self-describing — it emits no wiring, which arrives on composition.

See also

  • textbox — the flagship collapse consumer
  • label — lifted out of the collapse rather than consumed
  • Roles overview — the vocabulary and how roles are authored