Grapes homepage1.57.0
  • Guide
  • Tokens
  • Components
    Grapes on GithubGrapes on Figma
    Interaction
    • Button
    • IconButton
    • FloatingActionBar
    • Link
    Icons
    • Icon
    • HighlightIcon
    Form
    • AmountInput
    • Autocomplete
    • AutocompleteMultiple
    • AutocompletePlace
    • CheckboxBox
    • CheckboxField
    • DatePicker
    • FormField
    • Input
    • OptionGroup
    • PasswordInput
    • PhoneInput
    • RadioBox
    • RadioField
    • RadioGroup
    • Select
    • SwitchField
    • TextArea
    • TextInput
    • Upload
    • UploadButton
    Feedback
    • Badge
    • Banner
    • Callout
    • EmptyState
    • Modal
    • ModalSlideshow
    • DeprecatedModalSlideshow
    • PageModal
    • Skeleton
    • Tag
    • Toast
    • Tooltip
    Data display
    • Accordion
    • Avatar
    • Box
    • Calendar
    • CalendarRange
    • CollapsibleList
    • FileCard
    • InfoTip
    • ListBox
    • ListView
    • Panel
    • SidePanel
    • DeprecatedPreview
    • Table
    • Timeline
    • useDateFormatter
    Navigation
    • DropdownItem
    • DropdownMenu
    • Navigation
    • NavigationItem
    • Popover
    • Tabs

    TextInput

    A text field is an input that allows a user to write or edit text.

    View source code
    • Usage
    • Props
    • Accessibility
    • autoComplete
      string

      The autocomplete value for the input element.

    • className
      string

      className for the element.

    • defaultValue
      string | number

      The default value (uncontrolled).

    • fit
      "content" | "parent"

      Whether the Input should fit its parent or content.

      Default: content
    • id
      string

      The id of the Input.

    • inputMode
      "decimal" | "numeric"

      Type of data that might be entered, to display the appropriate virtual keyboard.

    • isDisabled
      boolean

      Whether the Input is disabled.

    • isInvalid
      boolean

      Whether the Input is invalid.

    • isReadOnly
      boolean

      Whether the Input should be read only.

    • leftAddon
      ReactNode

      Left addon of the input.

    • maskOptions
      CleaveOptions

      @deprecated This props will be removed in a near futur

    • max
      number

      Maximum value in a number input.

    • maxLength
      number

      The maximum number of characters supported by the Input.

    • min
      number

      Minimum value in a number input.

    • name
      string

      The name of the Input, used when submitting an HTML form.

    • onBlur
      FocusEventHandler<HTMLInputElement>

      Handler that is called when the element loses focus.

    • onChange
      ChangeEventHandler<HTMLInputElement>

      Handler that is called when the value changes.

    • onCopy
      ClipboardEventHandler<HTMLInputElement>

      Handler that is called when the user copies text.

    • onFocus
      FocusEventHandler<HTMLInputElement>

      Handler that is called when the element receives focus.

    • onKeyDown
      KeyboardEventHandler<HTMLInputElement>

      Handler that is called when a key is pressed.

    • onPaste
      ClipboardEventHandler<HTMLInputElement>

      Handler that is called when the user pastes text.

    • onWheel
      WheelEventHandler<HTMLInputElement>

      Handler that is called when the mouse is rolled over the element.

    • pattern
      string

      Regular expression that the input's value must match in order for the value to pass

    • placeholder
      string

      Temporary text that occupies the Input when it is empty.

    • ref
      Ref<HTMLInputElement>

    • rightAddon
      ReactNode

      Right addon of the input.

    • step
      string

      The interval between numbers in an input of type number.

    • textAlign
      "center" | "left" | "right"

      Specifies how the text is aligned.

      Default: left
    • value
      string | number

      The current value (controlled).

    • variant
      "default" | "magicGradient"

      The visual style of the input

      Default: default