TextInput()function

TextInput({
	name,
	title = "",
	placeholder = title, // Placeholder must be defined or `:placeholder-shown` CSS rules won't show.
	required = false,
	disabled = false,
	message = "",
	value,
	onValue,
	input = "text",
	min = 0,
	max = Number.POSITIVE_INFINITY,
	formatter = PASSTHROUGH,
	className,
	...variants
}: TextInputProps): ReactElement
ParamType
variantsTextInputProps
Props for TextInput, a single-line text input bound to a string value. required
    .inputStringInputType
type="" prop for HTML <input /> tags that are relevant for strings.
    .minnumber
    .maxnumber
    .formatterTextFormatter
Optional formatter — when provided the value is reformatted on blur and when initially displayed (the value published through onValue is never formatted).
Return
ReactElement
A text <input> element.

Single-line text input bound to a string value, rendered as an <input>. Use TextareaInput for multiline text.

  • Applies an optional formatter on initial display and on blur — the raw typed value is published through onValue.

Examples

<TextInput name="name" value={name} onValue={setName} />