Components
- Accordion
- Action Sheet
- Alert Dialog
- Alert
- Audio Player
- Audio Recorder
- Audio Waveform
- Avatar
- AvoidKeyboard
- Badge
- BottomSheet
- Button
- Camera Preview
- Camera
- Card
- Carousel
- Checkbox
- Collapsible
- Color Picker
- Combobox
- Date Picker
- File Picker
- Gallery
- Hello Wave
- Icon
- Image
- Input OTP
- Input
- Link
- MediaPicker
- Mode Toggle
- Onboarding
- ParallaxScrollView
- Picker
- Popover
- Progress
- Radio
- ScrollView
- SearchBar
- Separator
- Share
- Sheet
- Skeleton
- Spinner
- Switch
- Table
- Tabs
- Text
- Toast
- Toggle
- Video
- View
Installation
pnpm dlx bna-ui add input
Usage
import { Input, GroupedInput, GroupedInputItem } from '@/components/ui/input';<Input label='Username' placeholder='Enter your username' icon={User} />Examples
Default
With Icons
Variants
Validation States
Right Components
Disabled State
Grouped Inputs
Form Example
API Reference
Input
The main input component with label, validation, and icon support. Extends all TextInputProps except style.
| Prop | Type | Default | Description |
|---|---|---|---|
label | string | - | Label text displayed inside the input |
error | string | - | Error message to display below the input |
icon | React.ComponentType<LucideProps> | - | Lucide icon component to display on the left |
rightComponent | ReactNode | (() => ReactNode) | - | Component or function returning component for right side |
containerStyle | ViewStyle | - | Style for the outer container |
inputStyle | TextStyle | - | Style for the text input |
labelStyle | TextStyle | - | Style for the label text |
errorStyle | TextStyle | - | Style for the error message |
variant | 'filled' | 'outline' | 'filled' | Visual variant of the input |
disabled | boolean | false | Whether the input is disabled |
type | 'input' | 'textarea' | 'input' | Switches the layout to a multiline textarea when set to 'textarea'. |
rows | number | 4 | Number of visible text lines. Only used when type is "textarea". |
placeholder | string | 'Type your message...' when type is "textarea" | Placeholder text shown when the input is empty. type="textarea" falls back to a default when omitted; type="input" has no fallback. |
GroupedInput
Container component for grouping multiple inputs together.
| Prop | Type | Description |
|---|---|---|
children | ReactNode | Child components (usually GroupedInputItem) |
containerStyle | ViewStyle | Style for the container |
title | string | Optional title for the group |
titleStyle | TextStyle | Style for the title text |
GroupedInputItem
Input component designed to be used within GroupedInput. Extends all TextInputProps except style.
| Prop | Type | Default | Description |
|---|---|---|---|
label | string | - | Label text displayed inside the input |
error | string | - | Error message (displayed at group level) |
icon | React.ComponentType<LucideProps> | - | Lucide icon component to display on the left |
rightComponent | ReactNode | (() => ReactNode) | - | Component or function returning component for right side |
inputStyle | TextStyle | - | Style for the text input |
labelStyle | TextStyle | - | Style for the label text |
errorStyle | TextStyle | - | Style for the error message |
disabled | boolean | false | Whether the input is disabled |
type | 'input' | 'textarea' | 'input' | Switches the layout to a multiline textarea when set to 'textarea'. |
rows | number | 3 | Number of visible text lines. Only used when type is "textarea". |
Accessibility
The Input component is built with accessibility in mind:
- Proper focus management and keyboard navigation
- Screen reader support with semantic labeling
- High contrast support for error states
- Proper touch targets for mobile devices
- Support for dynamic text sizing
- Keyboard shortcuts and hardware keyboard support
Styling
The Input component uses your theme colors and can be customized:
filledvariant: Uses card background with subtle bordersoutlinevariant: Transparent background with prominent borders- Error states: Uses danger/red theme color
- Focus states: Uses primary theme color
- Disabled states: Reduced opacity with muted colors
Best Practices
- Use clear, descriptive labels
- Provide helpful placeholder text
- Show validation errors immediately after user interaction
- Group related inputs using GroupedInput
- Use appropriate input types (email, password, etc.)
- Consider using icons to clarify input purpose
- Ensure sufficient contrast for accessibility