Components
Textarea
A multiline text input for longer-form content entry.
The Textarea component wraps React Native's TextInput with multiline enabled, providing a styled multiline text area with consistent theming, focus rings, and placeholder support. It uses textAlignVertical="top" for proper text alignment.
Preview
Installation
npx novaui-cli add textareaImport
import { Textarea } from 'novaui-components'Basic Usage
A multiline text input with placeholder text:
import { Textarea } from 'novaui-components'
export function BasicTextarea() {
return <Textarea placeholder="Type your message..." />
}Examples
Custom Number of Lines
Control the initial height with numberOfLines:
<Textarea placeholder="Short input..." numberOfLines={2} />Disabled State
<Textarea placeholder="Cannot edit this textarea" editable={false} />With Value
import { useState } from 'react'
import { Textarea } from 'novaui-components'
export function ControlledTextarea() {
const [value, setValue] = useState(
'This is a pre-filled textarea with some content that the user can edit as needed.'
)
return (
<Textarea
value={value}
onChangeText={setValue}
placeholder="Enter description"
/>
)
}Props API
TextareaProps
Extends React.ComponentPropsWithoutRef<typeof TextInput> and includes:
| Prop | Type | Default | Description |
|---|---|---|---|
className | string | - | Additional CSS classes for custom styling |
numberOfLines | number | 4 | Number of visible text lines (controls initial height) |
placeholderTextColor | string | hsl(var(--muted-foreground)) | Color of the placeholder text |
The component automatically sets multiline to true and textAlignVertical to "top". All standard React Native TextInput props are also supported.
Best Practices
- Set appropriate height: Use
numberOfLinesto match the expected content length — 2-3 for short notes, 6+ for long-form content - Always include a placeholder: Help users understand what content is expected
- Use with Field: Wrap in a
Fieldcomponent with a label for accessible forms - Consider max length: Set
maxLengthto prevent overly long submissions when appropriate
Related Components
- Use with
FieldandFieldLabelfor labeled form layouts - Pair with
Inputfor single-line text fields - Combine with
Buttonfor form submission