rias/statamic-color-swatches
Statamic Color Swatches adds a configurable color picker fieldtype for the Statamic control panel, letting editors choose from predefined swatches and palettes instead of typing hex values. Keep brand colors consistent across entries and simplify content editing.
{ label, value[] }), which is a governance decision as much as a UI one: it makes "brand colors only" enforceable at the content layer instead of in a style guide nobody reads.value accepts an array of CSS strings and renders a linear-gradient, this supports gradients, duotone accents, and layered backgrounds — not just flat brand colors. That widens the use cases to hero backgrounds, category badges, and chart series without needing a second fieldtype.Consider adopting when:
{ label, value[] } — the stored shape is simple enough to map into design tokens or CSS custom properties at render time.Look elsewhere or build in-house when:
dist/ build is committed, which means auditing the shipped JS is a manual exercise.To executives: This is a small, free, open-source addon that constrains color choices in our CMS to an approved brand palette. The business outcome is brand consistency and fewer content QA cycles — editors pick from a curated list instead of pasting hex codes, so off-brand colors stop reaching production. Cost is near zero to adopt; the honest caveat is that it is a low-traffic community package with a single maintainer, so we should treat it as code we're willing to own rather than a supported vendor product.
To engineering: A Statamic v6 fieldtype addon with a well-bounded surface: one fieldtype class, a GraphQL type, two Vue 2 CP components registered through Statamic.$components, and a Vite build committed to dist/. Config defines named swatches; values are stored as { label, value: string[] }, with process() normalizing comma-separated strings into arrays and GraphQL resolving to the first color. Integration is a Composer require and a fieldset config entry. Risks are explicit and manageable: no test suite or static analysis, committed build artifacts, Vue 2 dependency inherited from the Statamic CP, and a bus factor of one. Recommend a timeboxed spike, vendor the package into our lockfile, and add a smoke test in our own suite covering field config → stored shape → GraphQL output so we detect breakage on Statamic upgrades.
To design/content ops: Editors get a row of clickable swatches with human-readable names, defined once in the fieldset, and multi-stop swatches render as gradients so accent and hero treatments are supported. The constraint is the feature — the palette becomes the single source of truth, and changing a brand color is a config change rather than a content audit.
How can I help you explore Laravel packages today?