
Summary
A highly capable alternative to Filament’s native Textarea.FlexTextareaField features smooth animated auto-sizing, character counters, integrated speech-to-text dictation, and an emoji picker. It also supports custom toolbar actions and selects.
| Class | Bjanczak\FilamentFlexFields\Filament\Forms\Components\FlexTextareaField |
| State type | string|null |
| Model cast | 'bio' => 'string' · 'content' => 'text' |
| FieldType | flex-textarea |
| Playground | flex-textarea slug in Flex Fields playground |
| Extends | Filament\Forms\Components\Textarea |
Basic usage
Auto-sizing with counter
Speech and Emoji support
State & validation
Stored value
The field stores a standard string. It inherits all validation rules from Filament’sTextarea.
Character Counter
WhencharacterCounter() is enabled, a live counter appears in the footer. If maxLength() is set, it shows “X / Max”.
Toolbar & Actions
Toolbar Selects
Add pill-style dropdowns to the field header to quickly insert templates or change states.Submit Actions
Add a primary action button (like “Send”) directly into the textarea suffix.Configuration API
All methods acceptClosure unless noted.
| Method | Type | Default | Description |
|---|---|---|---|
variant(string|Closure $variant) | Setup | 'primary' | primary, secondary, flat, soft |
characterCounter(bool|Closure $cond) | Setup | false | Show live character count |
animatedAutosize(bool|Closure $cond) | Setup | true | Smooth height transitions |
maxHeight(string|Closure|null $h) | Setup | '24rem' | Maximum auto-grow height |
footer(string|Closure|null $text) | Setup | null | Help text below the field |
speechDictation(bool|Closure $cond) | Setup | false | Enable browser speech-to-text |
emojiPicker(bool|Closure $cond) | Setup | false | Enable native emoji picker |
toolbarSelect(...) | Setup | — | Add dropdown to toolbar |
submitAction(Action|Closure $act) | Setup | — | Add primary suffix action |
size(string|Closure $size) | Setup | 'md' | sm, md, lg |
rounding(string|Closure $round) | Setup | config | Border radius token |
Real-world examples
Modern Chat Input
Playground
/admin/flex-fields-playground/flex-textarea
See Playground for setup.
Related components
| Component | When to use instead |
|---|---|
RichEditor | When HTML formatting (bold, links) is required |
| FlexTextInput | Single-line inputs |
| VoiceNoteRecorder | Recording audio files instead of dictation |
CSS classes (reference)
| Class | Role |
|---|---|
fff-flex-textarea-field | Root wrapper |
fff-flex-textarea-field--{variant} | Theme variant |
fff-flex-textarea-field__input | The actual textarea element |
fff-flex-textarea-field__toolbar | Top actions area |
fff-flex-textarea-field__footer | Bottom info area |
fff-flex-textarea-field__counter | Character count text |
fff-flex-textarea-field__speech-btn | Microphone button |
fff-flex-textarea-field__emoji-btn | Emoji button |