JSPM

color-selector-webcomponent

0.1.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 7
  • Score
    100M100P100Q36836F
  • License MIT

Simple color selector as Web Component

Package Exports

  • color-selector-webcomponent
  • color-selector-webcomponent/dist/index.cjs.js
  • color-selector-webcomponent/dist/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (color-selector-webcomponent) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Color Selector Web Component

This is a simple customizable color selector component build with stencil.

Installation

Script tag

The easiest way to add the selector to your website is by adding a CDN to your header.

    <script type="module" src="https://unpkg.com/color-selector-webcomponent/dist/colorselector/colorselector.esm.js"><script>
    <script nomodule src="https://unpkg.com/color-selector-webcomponent/dist/colorselector/colorselector.js"></script>

Node Modules

  • Run npm install color-selector-webcomponent --save
  • Put a script tag similar to this <script src='node_modules/color-selector-webcomponent/dist/colorselector/colorselector.esm.js></script> in the head of your index.html
  • Then you can use the element anywhere in your template

Usage

 <color-selector colors="#F4DB7D,#1A2238,#FF6A3D,#9DAAF2" value="#1A2238"></color-selector>

To customize, define the following CSS variables in your application:

  • --selector-background
  • --selector-border
  • --selector-border-radius
  • --selector-width
  • --selector-padding
  • --color-size
  • --color-border