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

box-image-picker

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

box-image-picker

Turn a simple <select> element into an Image Picker 🖼

  • 1.2.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Box Image Picker

release release npm

Turn a simple <select> element into an Image Picker 🖼

Box Image Picker Example

Installation

Just add the js & css files

<link rel="stylesheet" href="dist/box-image-picker.min.css" />
<script src="dist/box-image-picker.min.js"></script>

Usage

In your HTML file add your <select> element:

<select id="imagepicker">
    <option value="image1" data-img-src="image1.jpg">Image 1</option>
    <option value="image2" data-img-src="image2.jpg">Image 2</option>
    <option value="image3" data-img-src="image3.jpg">Image 3</option>
    <option value="image4" data-img-src="image4.jpg">Image 4</option>
</select>

And then in your JS file, add:

var imagepicker = new BoxImagePicker('#imagepicker', {
    // options
});

Options

OptionDefaultDescription
hide_selecttrueHide the original <select> element.
grid_col4The number of boxes in each row.
spacing5Padding in between the boxes.
border_size5The border width of the selected box.
show_labelfalseDisplay the option label at the bottom of each box.
onSelectfunction(index, value) {}Add your own callback function when a box is selected.

Methods

MethodArgumentsDescription
getSelected-Get the index and value of the selected image.

Development

Feel free to implement anything from the roadmap, submit pull requests, create issues, discuss ideas or spread the word.

Add Box Image Picker to your dev folder:

$ git clone git@github.com:jeffbocala/box-image-picker.git

Install dependencies (make sure you have yarn):

$ yarn install

To build your changes:

$ yarn build

or you can watch for changes using:

$ yarn dev

After git add-ing, commit your changes using:

$ yarn commit

DO NOT USE git commit.

Credit

Thanks for inspiration : https://github.com/rvera/image-picker

Built with ❤️ by Jeff Bocala

FAQs

Package last updated on 03 Dec 2018

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