Skip to content

feat: ability for RichEditor plugins to provide enabled/disabled toolbar buttons - #19260

Merged
danharrin merged 7 commits into
filamentphp:4.xfrom
ralphjsmit:rjs/plugin-enabled-disabled-toolbar-buttons
Feb 28, 2026
Merged

feat: ability for RichEditor plugins to provide enabled/disabled toolbar buttons#19260
danharrin merged 7 commits into
filamentphp:4.xfrom
ralphjsmit:rjs/plugin-enabled-disabled-toolbar-buttons

Conversation

@ralphjsmit

Copy link
Copy Markdown
Contributor

This PR provides the ability for RichEditor plugins to provide enabled/disabled toolbar buttons. For example, for a media-related rich editor plugin, it would be convenient that when a user adds the plugin to a RichEditor instance, the plugin would automatically disable the default attachFiles toolbar button and enable the custom toolbar button of itself instead.

use Filament\Forms\Components\RichEditor\Plugins\Contracts\HasToolbarButtons;
use Filament\Forms\Components\RichEditor\Plugins\Contracts\RichContentPlugin;

class HighlightRichContentPlugin implements RichContentPlugin, HasToolbarButtons
{
    // ... other methods ...

    /**
     * @return array<string | array<string | array<string>>>
     */
    public function getEnabledToolbarButtons(): array
    {
        return ['highlight', 'highlightWithCustomColor'];
    }

    /**
     * @return array<string>
     */
    public function getDisabledToolbarButtons(): array
    {
        return [];
    }
}

Thanks!

@danharrin danharrin added enhancement New feature or request pending review labels Feb 12, 2026
@danharrin danharrin added this to the v4 milestone Feb 12, 2026

@danharrin danharrin left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please rebase the commits on 4.x and retarget this PR

@ralphjsmit
ralphjsmit force-pushed the rjs/plugin-enabled-disabled-toolbar-buttons branch from b051b2b to 715ded1 Compare February 14, 2026 21:49
@ralphjsmit
ralphjsmit changed the base branch from 5.x to 4.x February 14, 2026 21:49
@ralphjsmit

Copy link
Copy Markdown
Contributor Author

@danharrin Re-targeted to 4.x.

@ralphjsmit
ralphjsmit force-pushed the rjs/plugin-enabled-disabled-toolbar-buttons branch from 6f470d5 to 18db2a5 Compare February 17, 2026 09:09
@danharrin
danharrin merged commit 3a3db66 into filamentphp:4.x Feb 28, 2026
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants