ndx/statamic-bard-color-picker
Adds a color picker to Statamic's Bard editor so content editors can apply custom text colors straight from the toolbar. Easy to install and configure, with a customizable palette to match your site's branding and keep rich-text styling consistent.
This addon registers a Bard (TipTap) toolbar button that lets editors wrap selected text in a color mark, with a configurable swatch palette shown in a popover.
Minimal setup:
composer require ndx/statamic-bard-color-picker. Check composer.json first to confirm Statamic 4/5 support; the addon is niche (11 stars, no dependents), so version constraints matter more than usual.php artisan vendor:publish --tag=statamic-bard-color-picker-config (confirm the tag in src/ServiceProvider.php's publishes() call). Defaults usually work for a first look.buttons array in your fieldset/blueprint:
-
handle: body
field:
type: bard
buttons:
- bold
- italic
- color_picker # use the exact handle registered in resources/js
config/statamic/bard-color-picker.php, or per-field if the field exposes a colors/swatches option.First use case: open an entry, select a sentence in a Bard field, click the color button, pick a swatch, save, and inspect the rendered HTML. Confirm whether the mark serializes to <span style="color: #..."> or to a class — your entire frontend styling strategy depends on that answer.
Where to look first: README.md → composer.json (Statamic version) → src/ServiceProvider.php (how the Bard extension and JS/CSS assets are registered) → resources/js/ (button handle, mark name, serialization) → config/ (palette and options). The JS is the real source of truth if docs are thin.
save_html: true is set on the Bard field, inline <span style="color:..."> flows straight into Antlers {{ body }}. If the field stores ProseMirror JSON, you must render through Bard's renderer — the mark has to be known to your schema or the color silently drops.**bold inside color** and links inside a colored span typically round-trip. Verify both directions (edit → save → re-edit) before shipping, since mark ordering affects output.style="color: #x" to class="text-x" so your Tailwind/config can control it.buttons: doesn't error — the button simply never appears. If nothing shows, diff the handle against the one in resources/js.php artisan cache:clear and php artisan config:clear, then hard-reload the Control Panel (cache-busted asset URLs are registered via the AddonServiceProvider $scripts/$styles arrays).config/statamic/purifier.php. span must be allowed and style permitted on it, otherwise inline color is stripped.save_html decision is load-bearing. Switch between HTML and ProseMirror JSON storage and colors will disappear or reappear unpredictably — decide early and migrate content if you change it.sanitize-html call or prose/typography reset can strip or override inline color styles. Either whitelist style on span or convert to utility classes.composer.json, watch the Statamic major line, and be prepared to read resources/js rather than rely on the README.How can I help you explore Laravel packages today?