Skip to main content

Input

The Input component is a flexible and customizable input field with support for various states, labels, clearable inputs, and enhancers. Below you will find detailed information about its props and how to use it.

Props

PropTypeDefaultDescription
state'danger' | 'success' | 'warning'nullIndicates the state of the input field, affecting its border and background.
labelstringnullA label to display above the input field.
infostringnullAdditional information or hint text displayed below the input field.
clearablebooleanfalseIf true, displays a clear button to reset the input field.
startEnhancerReactNodenullA node to display at the start of the input field.
endEnhancerReactNodenullA node to display at the end of the input field.
type'text' | 'password' | 'number''text'The type of the input field.
...propsReact.InputHTMLAttributesnullAdditional props for the input element.

Example Usage

Basic Input

<Input
label="Username"
placeholder="Enter your username"
/>

Input with Enhancers

<Input
label="Search"
placeholder="Search..."
startEnhancer={<span>🔍</span>}
/>
🔍

Clearable Input

<Input
label="Email"
placeholder="Enter your email"
clearable
/>

Password Input

<Input
label="Password"
type="password"
placeholder="Enter your password"
/>

Input with State

<Input
label="Username"
placeholder="Enter your username"
state="danger"
info="This username is already taken."
/>
This username is already taken.