gluestack-ui logo
Get Updates
Prompt to React Native UI
Home
Components
Hooks
Apps
MCP Server
Guides
Home
Overview
IntroductionQuick Start
Getting Started
InstallationTooling SetupVS Code ExtensionsFigma UI KitCLIgluestack-ui-nativewind-utils
Core Concepts
AccessibilityUniversal
Performance
Benchmarks
Theme Configuration
Default TokensCustomizing ThemeDark Mode
Components
All Components
Typography
HeadingrscTextrsc
Layout
BoxrscCenterrscDividerHStackrscVStackrscGridalpha, rsc
Feedback
AlertProgressSpinnerToast
Data Display
BadgeCardrscTablealpha
Forms
ButtonCheckboxFormControlInputLinkPressableRadioSelectSliderSwitchTextarea
Overlay
AlertDialogDrawerMenuModalPopoverPortalTooltip
Disclosure
ActionsheetAccordionBottomSheetalpha
Media And Icons
AvatarImageIconrsc
Others
FabSkeletonalpha, rsc
Hooks
useBreakPointValue
useMediaQuery
Apps
Dashboard App
Kitchensink App
Todo App
Starter Kit
MCP Server
MCP Server
Guides
Recipes
LinearGradient
Tutorials
Building Ecommerce App
More
Upgrade to v2Upgrade to v3FAQsReleasesRoadmapTroubleshootingDiscord FAQs

TextArea

Easily integrate a React & React Native Textarea component with multi-line input. Customize size, state, and accessibility for seamless UI. This is an illustration of TextArea component.
size
isReadOnly
isInvalid
isDisabled

Installation

Run the following command:

npx gluestack-ui add textarea

API Reference

To use this component in your project, include the following import statement in your file.
import { Textarea } from '@/components/ui/textarea';
anatomy-imageanatomy-image
export default () => (
  <Textarea>
    <TextareaInput />
  </Textarea>
);

Component Props

This section provides a comprehensive reference list for the component props, detailing descriptions, properties, types, and default behavior for easy project integration.

Textarea

It inherits all the properties of React Native's View component.
PropTypeDefaultDescription
size
'sm' | 'md' | 'lg' | 'xl''md'Changes the size of the Input Text
isInvalid
boolfalseWhen true, the input displays an error state.
isDisabled
boolfalseWhen true, the input is disabled and cannot be edited.
isHovered
boolfalseWhen true, the input displays a hover state.
isFocused
boolfalseWhen true, the input displays a focus state.
isRequired
boolfalseIf true, sets aria-required="true" on the input.
isReadOnly
boolfalseIf true, the input value cannot be edited.
Descendants Styling Props Props to style child components.
Sx PropDescription
_input
Prop to style TextareaInput Component

TextareaInput

Contains all TextInput related layout style props and actions. It inherits all the properties of React Native's TextInput component.

Accessibility

We have outlined the various features that ensure the Textarea component is accessible to all users, including those with disabilities. These features help ensure that your application is inclusive and meets accessibility standards.

Keyboard

  • setting the aria-label and aria-hint

Screen Reader

  • VoiceOver: accessible and aria-label props to describe the input's purpose
  • aria-traits
    and
    aria-hint
    for the various states of the input, such as "double tap to edit"

Props

Textarea component is created using TextInput component from react-native. It extends all the props supported by React Native Text Input and the props mentioned below.

Textarea

NameValueDefault
size
xl | lg | md | smmd

Data Attributes Table

Component receives states as props as boolean values, which are applied as
data-*
attributes. These attributes are then used to style the component via classNames, enabling state-based styling.
StateData AttributeValues
hover
data-hover
true | false
focus
data-focus
true | false
disabled
data-disabled
true | false
invalid
data-invalid
true | false

Examples

The Examples section provides visual representations of the different variants of the component, allowing you to quickly and easily determine which one best fits your needs. Simply copy the code and integrate it into your project.

FormControl

The Textarea Component can be incorporated within the FormControl.
Edit this page on GitHub
Go backSwitch
Up nextAlertDialog
Go backSwitch
Up nextAlertDialog