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,
	rows = 1,
	formatter = PASSTHROUGH,
	...variants
}: TextInputProps): ReactElement
ParamType
variantsTextInputProps
Props for TextInput, a single- or multi-line text input bound to a string value. required
    .rowsnumber
    .multilineboolean
    .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.
Return
ReactElement
A text <input> or <textarea> element.

Text input bound to a string value, rendered as an <input> or a <textarea> when rows > 1.

  • Applies an optional formatter on initial display and on blur.
  • Multiline mode auto-grows the textarea to fit its content.

Examples

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