TextInput is Clementine DS’s single-line free-text input. It wraps Mantine’s TextInput component and re-exports it with Clementine token bindings applied through ClementineDSProvider. Every prop that Mantine’s TextInput accepts is available here — import from @clementine-ds/ui, not from @mantine/core directly.
Use TextInput for short, open-ended string values: names, email addresses, search queries, passwords, and similar single-line data. For multi-line input use Textarea. For a closed list of options use Select.
When to use
- You need to capture a single line of free-form text from the user.
- The field maps to a value with no fixed set of options (names, emails, URLs, passwords, search terms).
- You need built-in support for a visible label, helper description, or inline error message without building your own wrapper.
- The form needs to participate in native browser autofill or autocomplete behavior.
When not to use
- Multi-line content — use
Textareainstead. - Closed option lists — use
Selectso users pick from known values rather than type freehand. - Numeric-only input — consider a dedicated number input to get browser increment controls and correct keyboard behavior.
- Rich text — a plain
TextInputcannot format text; reach for a rich-text editor (not yet in this DS).
Usage
Controlled usage
Uncontrolled usage with FormData
Props
TextInputProps extends Mantine’s TextInputProps directly — all Mantine props are available. The table below covers the props you’ll use most often.
Interaction states
Clementine DS tokens cover all documented interaction states forTextInput.
Token contract
These design tokens fully coverTextInput. All tokens resolve through semantic aliases into the Clementine primitive palette.
Accessibility
- Always supply a visible
labelprop. Usearia-labelonly as a last resort when no visible label is possible. - On error, Mantine sets
aria-invalid="true"on the input and associates the error element viaaria-describedby. Verify this wiring in your form — see the spec open item below. - Preserve native browser autofill by setting the
nameandautoCompleteattributes appropriately. - The
requiredprop sets the nativerequiredattribute, which screen readers announce. If you usewithAsteriskinstead (visual-only), communicate the requirement through thedescriptionprop as well. TextInputsupports all standard keyboard interactions —Tabto focus,Shift+Tabto move backwards, standard text editing keys inside the field.
Draft status
TextInput carries a Draft status as of clementine-ds@HEAD (2026-06-08). The following items are still open:
- Full interaction-state coverage in Storybook (hover, focus, loading stories are missing).
aria-describedby→ helperidwiring needs verification against the spec’s ARIA requirements.- Component token values (
text-input.border.hover,text-input.fg.disabled,text-input.radius) are defined in the spec but not yet validated against the rendered output.