Text field
Filled or outlined text input with a floating label, icons, affixes, counter, error icon and a text area.
import { TextField } from '@windmorph/react';Purpose
Text fields let people enter and edit text. Reach for one for free-form input like a name, email or message; use a Select, RadioGroup or Checkbox when the choices are fixed.
Every field needs a name: pass a visible label or, when the context already makes the purpose clear, an aria-label / aria-labelledby (the types enforce one). The value is controlled through value / onChange(value) or left uncontrolled with defaultValue.
Do and don't
errorMessage.When not to use
For a yes/no choice use a Checkbox or Switch; for picking one of a few options use a Radio group.
See also
- Text field on m3.material.io: Material's own guidelines, with anatomy and specs.
- Checkbox: Selects any number of options, with checked, unchecked and indeterminate states.
- Radio group: A set of radio buttons for picking exactly one option; a Radio needs a RadioGroup.
- Slider: Chooses a value or a range on a continuous or stepped scale, in five sizes.