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
labelstring—Input label
typestring'text'HTML input type
placeholderstring—Placeholder text
descriptionstring—Helper text below input
errorMessagestring—Error text (also sets invalid state)
prefixReactNode—Icon or text before input
suffixReactNode—Icon or text after input
isDisabledboolean—Disable the input
size'sm' | 'md' | 'lg''md'Input size

On this page