Skip to content

Forms

Input

Bundle size
23.5 KB
3.1.0

A multipurpose form input field to capture user data.

This is an original component from Inpulse.

Input was designed from the ground up to be a versatile, all-in-one form field. Within a single component, you get:

  1. A standard input field for text, number, email and more.
  2. A password field with a built-in visibility toggle.
  3. A text field with value masking for a smoother user experience.
  4. A smart multi-line field.

All of this comes in 5 variations to fit a wide range of use cases.

Our goal with Input is to provide the definitive text input — combining the features developers expect with an intuitive API. Under the hood, it leverages two excellent libraries to power its functionality: imask and react-textarea-autosize.

Terminal window
pnpm add @inpulse-ui/input

A native input or textarea element will be rendered based on the configuration.

PropTypeDefault ValueRequired
disabledbooleanfalseNo
labelstringInputNo
locale

enum

No
maskstring-No
namestring-Yes
onChangefunction-No
placeholderstring-No
preset

enum

No
requiredbooleanfalseNo
rowsnumber-No
size

enum

No
type

enum

No
variant

enum

No
AttributeValue
[data-variant]

Instantiate the component within a form context and set an appropriate name attribute, otherwise it won’t be rendered. The name attribute must be unique within the form for proper functionality.

import { Input } from '@inpulse-ui/input';
<Form {...useFormProps}>
<Input name="field" label="Input" />
</Form>

The default variant offers a clean, modern look suitable for most applications. The label is integrated into the input field and dynamically floats based on user interaction, delivering a seamless and intuitive experience.

Similar to the standard variant but the label animation breaks the edges of the input, creating additional space for its elements.

The line variant provides a minimalist approach with an underlined style.

The ghost variant offers an unopinionated design, allowing it to be easily integrated into any layout.

The raw variant delivers a neutral approach, closely resembling the native text input experience.

Control text input in Input through a mask. It is possible to define the mask completely freely using the mask property or choose one of the pre-defined masks using the preset property.

The preset property always overrides the mask property - if there is a predefined mask for the chosen value. The available options are:

Preset🇺🇸🇧🇷Description
phonePhone number
zipcodePostal code
ssn-Social Security Number
cpf-Cadastro de Pessoa Física
cnpj-Cadastro Nacional de Pessoas Jurídicas

It is also worth mentioning that the use of the preset property depends on the locale property. For example, the mask of the zipcode preset is different for pt_BR (00000-000) and en_US (00000). This is especially useful for projects that support multiple languages. If locale is not set, the language en_US will be set by default.

Password fields can be created via the type property. If password is chosen, a secret visibility toggle button will be displayed in the field. When you click this button, the text visibility will be switched between visible and hidden.

It is possible to convert the text field into a multi-line field through the rows property. The value of this property defines the maximum number of lines visible in the field, until the content starts to generate a vertical scroll. By default, the minimum number of visible lines will always be 2.

The disabled prop prevents user interaction, making it clear that the input is not available for editing. It maintains the same visual style as the default variant but applies a muted color scheme to indicate its inactive state.

It is possible to define the size of the text field using the size property. The available options are sm, md and lg.

You can use an external label for the input field by placing a Label component before it and applying the raw variant to the Input.

Project

Built with by Jo Santana in Brazil.

© 2026 Inpulse. All rights reserved.