Trumbowyg wysiwyg editor field for Filament.
Warning: This field does not work with the Filament block builder. I'm actively trying to make this compatible and will hopefully have an update in the near future. The WYSIWYG default theme may also not work as expected in some cases with the Filament 3 theming. If you're using Filament in light mode make sure to set
reset_css
tofalse
in thefilament-trumbowyg.php
config in a future update I will be adding the ability to customise the WYSIWYG theme.
You can install the package via composer:
composer require jkharley/filament-trumbowyg
use JKHarley\FilamentTrumbowyg\Trumbowyg;
Trumbowyg::make('my-field')
You can customise the buttons pane by passing an array of buttons to the buttons key in the filament-trumbowyg
config file. This will overwrite the default buttons pane set by Trumbowyg and will be used across all Trumbowyg
fields.
php artisan vendor:publish --tag="filament-trumbowyg-config"
// config/filament-trumbowyg.php
'buttons' => [
['undo', 'redo'],
['strong', 'em', 'del'],
'link',
'fullscreen',
]
Alternatively you can pass an array of buttons to the buttons
method on the field.
You can also use this to overwrite the buttons set in the config file for a specific field.
Trumbowyg::make('my-field')
->buttons([
['undo', 'redo'],
['strong', 'em', 'del'],
'link',
'fullscreen',
]),
Most options under the basic options
selection on the Trumbowyg website are supported with this field. Each option can be added as a chained method on the field or all fields can default to a value set in the config file. Here are the options that can be passed with an example value:
Trumbowyg::make('my-field')
->tagClasses([])
->changeActiveDropdownIcon(true)
->removeFormatPasted(true)
->tagsToRemove(['script'])
->tagsToKeep([])
->minimalLinks(true)
->linkTargets(['_self'])
->imageWidthModalEdit(true)
->urlProtocol('ftp')
- Localization
- Theme customisation
- SVG icon customisation
Please see CHANGELOG for more information on what has changed recently.
Please see CONTRIBUTING for details.
Please review our security policy on how to report security vulnerabilities.
The MIT License (MIT). Please see License File for more information.