Skip to main content
The textarea component allows you to interact with multi-line text.

Basic Usage

use Filament\Forms\Components\Textarea;

Textarea::make('description')

Available Methods

rows
method
Sets the number of rows.
Textarea::make('description')
    ->rows(10)
cols
method
Sets the number of columns.
Textarea::make('description')
    ->cols(20)
autosize
method
Makes textarea automatically resize.
Textarea::make('description')
    ->autosize()
readOnly
method
Makes the textarea read-only.
Textarea::make('notes')
    ->readOnly()
disableGrammarly
method
Disables Grammarly.
Textarea::make('code')
    ->disableGrammarly()
trim
method
Trims whitespace from the textarea.
Textarea::make('description')
    ->trim()
minLength
method
Sets minimum length validation.
Textarea::make('description')
    ->minLength(10)
maxLength
method
Sets maximum length validation.
Textarea::make('description')
    ->maxLength(1000)
length
method
Sets exact length validation.
Textarea::make('tweet')
    ->length(280)
placeholder
method
Sets placeholder text.
Textarea::make('description')
    ->placeholder('Enter a detailed description...')

Common Patterns

Product Description

Textarea::make('description')
    ->rows(5)
    ->maxLength(1000)
    ->required()

Auto-sizing Notes

Textarea::make('notes')
    ->autosize()
    ->placeholder('Add your notes here...')

Code Snippet

Textarea::make('code')
    ->rows(10)
    ->disableGrammarly()
    ->extraAttributes(['class' => 'font-mono'])

Comment Field

Textarea::make('comment')
    ->rows(4)
    ->minLength(10)
    ->maxLength(500)
    ->required()

Bio Field

Textarea::make('bio')
    ->autosize()
    ->maxLength(500)
    ->placeholder('Tell us about yourself...')

Build docs developers (and LLMs) love