Skip to main content

Input

The Input component supports 14+ different input types including text, email, password, date, phone, IBAN, credit card, and more.

Features​

  • πŸ“ 14+ input types
  • βœ… Validation support
  • 🎭 Input masking
  • πŸ“… Date/DateTime pickers
  • πŸ” Search with autocomplete
  • πŸ’° Amount input
  • β˜‘οΈ Checkbox variant
  • 🎨 Light/dark themes

Basic Usage​

import {Input} from '@tansuk/rott-ui'

<Input
name='email'
type='email'
placeholder='Enter your email'
value={email}
onChangeText={setEmail}
/>

Input Types​

Each input type has its own dedicated page with specific props, examples, and best practices:

  • Amount - Currency and numeric input with formatting
  • Checkbox - Checkbox input
  • Credit Card - Credit card number with masking
  • CVC - Card security code
  • Date - Date and datetime picker
  • Email - Email input with validation
  • Expire Date - Card expiration date
  • IBAN - IBAN with formatting
  • Numeric - Numbers only
  • Password - Password with show/hide
  • Phone - Phone number with masking
  • PIN - PIN/OTP input
  • Search - Search with autocomplete
  • Select - Dropdown select

With Labels​

<Input
name="email"
type="email"
label="Email Address"
placeholder="Enter your email"
/>

Validation​

<Input
name="email"
type="email"
placeholder="Email"
value={email}
onChangeText={setEmail}
errorMessage={errors.email}
touched={touched.email}
/>

Props​

PropTypeDefaultDescription
namestringRequiredInput identifier
typeInputType'default'Input type
valuestring-Input value
onChangeText(text: string) => void-Change handler
placeholderstring-Placeholder text
labelstring | InputLabelProps-Input label
errorMessagestring-Error message
touchedbooleanfalseTouched state
theme'light' | 'dark''light'Theme
disabledbooleanfalseDisabled state

Quick Example​

import {Input} from '@tansuk/rott-ui'

// Basic text input
<Input name='username' type='default' placeholder='Username' />

// Email with validation
<Input name='email' type='email' label='Email' />

// Password with show/hide
<Input name='password' type='password' label='Password' />

// Phone with masking
<Input name='phone' type='phone' mask='+1 ([000]) [000]-[0000]' />
  • Forms Guide - Complete form examples with validation
  • Toggle - Toggle switch component