Skip to content

yourfrienderin/netlify-cms-widget-color

 
 

Repository files navigation

netlify-cms-widget-color

Simple Netlify CMS color widget using react-color

Install and Usage

As an npm package:

npm install --save netlify-cms-widget-color
import { ColorControl } from 'netlify-cms-widget-color'

CMS.registerWidget('color', ColorControl)

Add to your config.yml:

    fields:
      - { name: <fieldname>, label: <fieldlabel>, widget: color }

Via script tag:

<script src="https://unpkg.com/netlify-cms"></script>
<script src="https://unpkg.com/netlify-cms-widget-color"></script>

Note: it is already registered with name netlify-cms-widget-color so you can just use that on your config.yml

Configuration Options

Option Type Default Description
alpha bool true enable alpha
presets array undefined Define presets color
default string #ffffff Default color

Example:

- label: "Theme Color"
  name: "color"
  widget: "color"
  format: 'hsl'
  presets: ['red', 'green', 'blue'], default: 'pink'
  alpha: false

Support

For help with this widget, open an issue or ask the Netlify CMS community in Gitter.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 88.6%
  • HTML 11.4%