Components
Input
A styled text input field for capturing user text data.
The Input component wraps React Native's TextInput with consistent styling, focus ring support, and placeholder theming. It integrates seamlessly with form layouts and supports disabled states.
Preview
Installation
npx novaui-cli add inputImport
import { Input } from 'novaui-components'Basic Usage
A simple text input with a placeholder:
import { Input } from 'novaui-components'
export function BasicInput() {
return <Input placeholder="Enter your name" />
}Examples
Email Input
<Input
placeholder="you@example.com"
keyboardType="email-address"
autoCapitalize="none"
/>Disabled State
<Input placeholder="Cannot edit" editable={false} />With Value
import { useState } from 'react'
import { Input } from 'novaui-components'
export function ControlledInput() {
const [value, setValue] = useState('John Doe')
return (
<Input
value={value}
onChangeText={setValue}
placeholder="Full name"
/>
)
}Props API
InputProps
Extends React.ComponentPropsWithoutRef<typeof TextInput> and includes:
| Prop | Type | Default | Description |
|---|---|---|---|
className | string | - | Additional CSS classes for custom styling |
placeholderTextColor | string | hsl(var(--muted-foreground)) | Color of the placeholder text |
editable | boolean | true | When false, the input is disabled with reduced opacity |
All standard React Native TextInput props are also supported (value, onChangeText, keyboardType, autoCapitalize, etc.).
Best Practices
- Always include a placeholder: Provide clear placeholder text to indicate the expected input format
- Use with Field: Wrap inputs in a
Fieldcomponent with a label for accessible forms - Keyboard types: Set appropriate
keyboardTypefor the data type (email, phone, numeric) - Controlled inputs: Use
valueandonChangeTextfor form state management
Related Components
- Use with
FieldandFieldLabelfor labeled form inputs - Combine with
InputGroupfor inputs with icons or addons - Pair with
Textareafor multiline text entry - Use
InputOTPfor verification code inputs