Input field that only accepts hex colors. Shows you a preview of the entered color in author and preview mode.
As an npm package:
npm i netlify-cms-color-field
import { Control, Preview } from 'netlify-cms-color-field'
CMS.registerWidget('colorField', Control, Preview)
Via script
tag:
<script src="https://unpkg.com/netlify-cms-color-field@^1.0.0"></script>
<script>
CMS.registerWidget('colorField', Control, Preview)
</script>
Add to your Netlify CMS configuration:
fields:
- { name: <fieldname>, label: <fieldlabel>, widget: colorField }
For help with this widget, open an issue or ask the Netlify CMS community in Gitter.