Skip to content
v2.5.0
English
Русский
Documentation

TextField

TextField is a compound component for single-line text entry.

Root Props

PropTypeDefault
sizeTextFieldSize'md'
Visual size of the text field. Affects padding, font size, and overall height. 'sm': Compact input; 'md': Default; 'lg': Spacious layout
errorboolean—
Shows the input in an error state.
refRef<HTMLDivElement>—
Ref forwarded to wrapper element Useful for programmatic control, focus, or integration.

Also accepts all <div> attributes.

Child Parts

  • TextFieldInput: native <input> element used inside the wrapper.

TextFieldInput

PropTypeDefault
refRef<HTMLInputElement>—
Ref forwarded to the underlying native <input> element.

Also accepts all <input> attributes.

Types

  • TextFieldProps
  • TextFieldInputProps
  • TextFieldSize

State Model

  • TextField exposes size and error state through context.
  • Real input state is managed on TextFieldInput.
  • Controlled and uncontrolled behavior follow native input rules on the child input.