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

elab

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

elab

Multiple selection with just markup.

  • 0.3.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

elab

Multiple selection with just markup.

Demo / CodePen

Installation

via npm (with a module bundler)

$ npm install elab
import 'elab/simple/simple.css' // or 'elab/material/material.css'
import 'elab/simple/simple.js'  // or 'elab/material/material.js'

via CDN (jsDelivr)

<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/elab@0.3.0/simple/simple.css" />
<script src="https://cdn.jsdelivr.net/npm/elab@0.3.0/simple/simple.js"></script>
<!-- or
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/elab@0.3.0/material/material.css" />
<script src="https://cdn.jsdelivr.net/npm/elab@0.3.0/material/material.js"></script>
-->

Download

simple.css simple.js

material.css material.js

Usage

<!-- 1. Load CSS and JS. -->
<link rel="stylesheet" href="elab/simple.css" />
<script src="elab/simple.js"></script>

<!-- 2. Place an element having "elab" class and `tabindex` attribute.
        [Optional] Add "elab-wrap" class to apply word-wrap.
        [Optional] Listen to "change" and "close" events using `addEventListener()` or `on-` attributes.
        `event.detail.values` is an array having selected values. -->
<div
  class="elab elab-wrap"
  tabindex="0"
  onchange="console.log(arguments[0].detail.values)"
  onclose="console.log(arguments[0].detail.values)"
>
  <ul>
    <!-- 3. [Optional] Place an item having `data-selected-all` to indicate or toggle all items. -->
    <li data-selected-all>All</li>

    <!-- 4. Place items having `data-value` with `data-selected` or `data-disabled` as appropriate. -->
    <li data-value="cupcake">Cupcake</li>
    <li data-value="donut">Donut</li>
    <li data-value="eclair" data-selected>Eclair</li>
    <li data-value="froyo" data-disabled>Froyo</li>
    <li data-value="gingerbread">Gingerbread</li>
    <li data-value="honeycomb">Honeycomb</li>
    <li data-value="ice" data-selected>Ice</li>

    <!-- 5. [Optional] Place an item having `data-placeholder` at last to display the placeholder. -->
    <li data-placeholder>Select...</li>
  </ul>

  <!-- 6. [Optional] Place an icon to indicate this is a dropdown, such as "▾". -->
  <div style="padding: 0 0.5em;"></div>
</div>

License

WTFPL

Keywords

FAQs

Package last updated on 04 Jul 2021

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