Input

An input field for collecting user input.

Example

Anatomy

<Input />

Usage

import { Input, NumberInput } from '@ivaldi/ui'
<Input placeholder="Enter your name" />

Text Input

<Input type="text" placeholder="Username" />

Password Input

<Input type="password" placeholder="Enter password" />

Email Input

<Input 
  type="email" 
  placeholder="email@example.com" 
  autoComplete="email" 
/>

Number Input

<Input 
  type="number" 
  placeholder="Amount" 
  min={0} 
  max={100} 
/>

With Label

<div className="space-y-2">
  <Label htmlFor="name">Name</Label>
  <Input id="name" placeholder="Enter your name" />
</div>

Disabled State

<Input disabled placeholder="Disabled input" />

File Input

<Input type="file" accept="image/*" />

Required Input

<div className="space-y-2">
  <Label htmlFor="required">
    Required Field <span className="text-danger-text">*</span>
  </Label>
  <Input id="required" required />
</div>

With Error Style

<div className="space-y-2">
  <Label htmlFor="error">Username</Label>
  <Input 
    id="error" 
    className="border-danger-border" 
    placeholder="Invalid input"
    isInvalid
  />
  <p className="text-sm text-danger-text">
    This field is required
  </p>
</div>

Search Input

<div className="relative">
  <SearchIcon className="absolute left-3 top-1/2 -translate-y-1/2 size-4 text-muted" />
  <Input 
    type="search" 
    placeholder="Search..." 
    className="pl-9"
  />
</div>

NumberInput Props

PropTypeDefault

Input Props

PropTypeDefault

SearchInput Props

PropTypeDefault