Adding a Rich Text editor to a custom resource page

I’m building a custom Filament resource page, and I’d like to include the same RichEditor that Filament uses in forms - instead of a plain <textarea> like this:
<label for="description-{{ md5($modelPath) }}" class="block text-sm font-medium mb-2">
Description
</label>

<x-filament::input.wrapper class="rounded-lg">
<x-filament::input
tag="textarea"
id="description-{{ md5($modelPath) }}"
rows="5"
wire:model.defer="{{ $modelPath }}.description"
placeholder="Enter a description..."
class="min-h-[6rem] !leading-normal align-top !rounded-xl !shadow-none resize-y"
/>
</x-filament::input.wrapper>


<label for="description-{{ md5($modelPath) }}" class="block text-sm font-medium mb-2">
Description
</label>

<x-filament::input.wrapper class="rounded-lg">
<x-filament::input
tag="textarea"
id="description-{{ md5($modelPath) }}"
rows="5"
wire:model.defer="{{ $modelPath }}.description"
placeholder="Enter a description..."
class="min-h-[6rem] !leading-normal align-top !rounded-xl !shadow-none resize-y"
/>
</x-filament::input.wrapper>


What’s the recommended way to replace this with Filament’s built-in RichEditor? Any best-practice examples or tips would be really appreciated.
3 Replies
krekas
krekas4w ago
why don't you add a filament form?
Amelia
Amelia4w ago
- Use statePath (like 'data') for predictable state management. - Use the same component and schema style Filament uses for resources for better consistency. - If you need custom configuration (file uploads, blocks, etc.), use the RichEditor API as shown in the documentation.​ - Always validate and sanitize RichEditor input before saving to your database.
awcodes
awcodes4w ago
You will have to use a form in the page to be able to use the RichEditor. The blade file won’t work on its own since it depends on methods from the Field class to be able to render and work.

Did you find this page helpful?