Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

vanilla-picker

Package Overview
Dependencies
Maintainers
1
Versions
36
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vanilla-picker

A simple, easy to use vanilla JS color picker with alpha selection.

  • 2.12.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
316K
increased by14.76%
Maintainers
1
Weekly downloads
 
Created

What is vanilla-picker?

The vanilla-picker npm package is a lightweight, zero-dependency color picker for web applications. It provides a simple and intuitive interface for users to select colors, and it can be easily integrated into any web project.

What are vanilla-picker's main functionalities?

Basic Color Picker

This code initializes a basic color picker and attaches it to the body of the document. Users can interact with the picker to select a color.

const picker = new Picker({ parent: document.body });

Custom Color Picker Position

This code initializes a color picker and positions the popup at the top of the parent element. The 'popup' option allows customization of the picker's position.

const picker = new Picker({ parent: document.body, popup: 'top' });

Color Change Event

This code initializes a color picker and sets up an event listener for color changes. When the user selects a new color, the color's RGBA string is logged to the console.

const picker = new Picker({ parent: document.body }); picker.onChange = function(color) { console.log(color.rgbaString); };

Initial Color

This code initializes a color picker with an initial color set to red (#ff0000). The 'color' option allows setting a default color when the picker is first displayed.

const picker = new Picker({ parent: document.body, color: '#ff0000' });

Other packages similar to vanilla-picker

Keywords

FAQs

Package last updated on 23 Mar 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc