© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•2y ago•
9 replies
urbycoz

How can I set default text in a RichEditor?

I want the content to display some custom text instead just being blank. Things like textInputs support
->default()
->default()
but that doesn't seem to work for RichEditors.

RichEditor::make('summary')
                ->default('my default text')
RichEditor::make('summary')
                ->default('my default text')
Solution
Think I've found a workaround:

->formatStateUsing(function ($state) {
                    if ($state) {
                        return $state;
                    }
                    else {
                        return 'my default text';
                    }
                })
->formatStateUsing(function ($state) {
                    if ($state) {
                        return $state;
                    }
                    else {
                        return 'my default text';
                    }
                })


Not sure if there's a better way though.
Jump to solution
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

In RichEditor Image how can set alt text
FilamentFFilament / ❓┊help
6mo ago
Richeditor v4, set default height
FilamentFFilament / ❓┊help
8mo ago
How can i remove this default label text in resource
FilamentFFilament / ❓┊help
2y ago