oliwol / filament-rich-editor-heroicons
A seamless integration for Filament v4/v5 that allows users to insert Heroicons directly into the RichEditor (TipTap). Enhance your content by adding scalable vector icons with a dedicated picker button.
Fund package maintenance!
oliwol
Installs: 187
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 0
Forks: 0
Open Issues: 0
pkg:composer/oliwol/filament-rich-editor-heroicons
Requires
- php: ^8.2
- filament/filament: ^v4.0|^v5.0
- spatie/laravel-package-tools: ^1.15.0
- ueberdosis/tiptap-php: ^2.0
Requires (Dev)
- laravel/pint: ^1.25.0
- orchestra/testbench: ^10.0
- pestphp/pest: ^3.0|^4.0
- phpstan/phpstan: ^2.0
- rector/rector: ^2.0
This package is auto-updated.
Last update: 2026-02-05 11:34:22 UTC
README
A Filament v4/v5 plugin that adds a Heroicon picker to the RichEditor (TipTap). Search and insert any outline Heroicon as an inline SVG directly into the editor content.
🚀 Installation
Install the package via Composer:
composer require oliwol/filament-rich-editor-heroicons
⚡️ Quick Start
use Filament\Forms\Components\RichEditor; use Oliwol\FilamentRichEditorHeroicons\FilamentRichEditorHeroicons; RichEditor::make('content') ->toolbarButtons([ 'bold', 'italic', 'link', 'addHeroicon', ]) ->plugins([ FilamentRichEditorHeroicons::make(), ])
🛠️ Usage
Editor Integration
Add FilamentRichEditorHeroicons::make() to the plugins() array of your RichEditor component and include addHeroicon in the toolbarButtons():
use Filament\Forms\Components\RichEditor; use Oliwol\FilamentRichEditorHeroicons\FilamentRichEditorHeroicons; RichEditor::make('content') ->toolbarButtons([ 'bold', 'italic', 'underline', 'link', 'addHeroicon', // ... other buttons ]) ->plugins([ FilamentRichEditorHeroicons::make(), ])
Rendering Stored Content
When rendering stored content outside the editor (e.g. in a Blade view or model accessor), register the plugin with RichContentRenderer:
use Filament\Forms\Components\RichEditor\RichContentRenderer; use Oliwol\FilamentRichEditorHeroicons\FilamentRichEditorHeroicons; RichContentRenderer::make($this->html) ->plugins([ FilamentRichEditorHeroicons::make(), ])
⚙️ How it works
- Clicking the toolbar button opens a modal with a searchable dropdown of all outline Heroicons.
- After selecting an icon, it is rendered as an inline SVG element and inserted into the editor content.
- The icon name is stored as a
data-iconattribute, and the rendered SVG is stored asdata-svgfor display.
🌍 Translations
The package ships with English and German translations. You can publish and customize them:
php artisan vendor:publish --tag="filament-rich-editor-heroicons-translations"
✅ Testing
composer test
📄 License
This package is open-sourced software licensed under the MIT license.