pro-ui

Input

Text input field with label, description, error, and prefix/suffix icons. Built on React Aria.

Import

import { Input } from '@dangbt/pro-ui'

Basic usage

<Input label="Email" type="email" placeholder="you@example.com" />

With prefix icon

import { Search, Mail } from 'lucide-react'
 
<Input label="Email" prefix={<Mail size={14} />} type="email" />
<Input label="Search" prefix={<Search size={14} />} placeholder="Search..." />

With error

<Input
  label="Username"
  errorMessage="Username is already taken"
/>

With helper text

<Input
  label="Password"
  type="password"
  description="Minimum 8 characters"
/>

Props

PropTypeDefaultDescription
labelstringInput label
typestring'text'HTML input type
placeholderstringPlaceholder text
descriptionstringHelper text below input
errorMessagestringError text (also sets invalid state)
prefixReactNodeIcon or text before input
suffixReactNodeIcon or text after input
isDisabledbooleanDisable the input
size'sm' | 'md' | 'lg''md'Input size

On this page