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.
Package info
github.com/oliwol/filament-rich-editor-heroicons
pkg:composer/oliwol/filament-rich-editor-heroicons
Fund package maintenance!
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
- 1.x-dev
- v1.0.1
- v1.0.0
- 0.x-dev
- v0.0.2
- v0.0.1
- dev-19-feat-icon-color-picker
- dev-18-feat-support-mini-20x20-heroicon-style
- dev-36-switching-between-solid-and-outline-clears-the-selected-icon-instead-of-keeping-it
- dev-20-feat-click-to-edit-an-already-inserted-icon
- dev-17-feat-support-solid-heroicon-style
- dev-chore/update-animated-gif
- dev-chore/update-changelog
- dev-16-docs-add-changelogmd
- dev-14-feat-add-translations-for-common-languages
- dev-chore/add-tests-for-configurable-icon-size
- dev-13-feat-configurable-icon-size-on-insertion
This package is auto-updated.
Last update: 2026-03-27 06:42:04 UTC
README
A Filament v4/v5 plugin that adds a Heroicon picker to the RichEditor (TipTap).
Search and insert Heroicons as inline SVGs directly into the editor content. Supports outline, solid, and mini styles with customizable size, alignment, and color.
🚀 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(), ])
Styles
By default, outline, solid, and mini styles are available. Mini icons use a 20x20 viewport, designed for smaller UI elements.
To restrict to specific styles:
FilamentRichEditorHeroicons::make() ->styles(['outline', 'solid'])
Alignment & Size
The picker modal lets users choose alignment and size for each icon. You can customize the available sizes and default size via the plugin API:
FilamentRichEditorHeroicons::make() ->defaultSize('lg') ->sizes([ 'sm' => 16, 'md' => 24, 'lg' => 32, 'xl' => 48, ])
Alignment options: Inline (default), Left, Center, Right
Size presets: S (16px), M (24px, default), L (32px), XL (48px)
Color
The picker modal includes a color picker to set the icon color. The default color is #000000 (black).
Editing Inserted Icons
Click on any inserted icon in the editor to re-open the picker modal pre-filled with the current settings. Changes update the icon in place.
All settings are persisted in the editor content and applied consistently when rendering via RichContentRenderer.
⚙️ How it works
- Clicking the toolbar button opens a modal with a searchable dropdown of Heroicons with SVG previews.
- Select a style (outline/solid/mini), alignment, size, and color.
- The icon is rendered as an inline SVG element and inserted into the editor content.
- Clicking an existing icon re-opens the modal for editing.
- All properties are stored as data attributes and applied on render.
🌍 Translations
The package ships with translations for the following languages:
| Language | Code |
|---|---|
| English | en |
| German | de |
| French | fr |
| Spanish | es |
| Portuguese (Brazil) | pt_BR |
| Dutch | nl |
| Italian | it |
| Turkish | tr |
| Arabic | ar |
| Chinese (Simplified) | zh_CN |
You can publish and customize them:
php artisan vendor:publish --tag="filament-rich-editor-heroicons-translations"
✅ Testing
composer test
📝 Changelog
Please see CHANGELOG for more information on what has changed recently.
📄 License
This package is open-sourced software licensed under the MIT license.