Socket
Book a DemoInstallSign in
Socket

makeup-listbox-button

Package Overview
Dependencies
Maintainers
0
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

makeup-listbox-button

A JavaScript class representing an ARIA listbox button

latest
Source
npmnpm
Version
0.5.12
Version published
Maintainers
0
Created
Source

makeup-listbox-button

A JavaScript class that represents an ARIA listbox button. No CSS provided.

View Demo.

HTML

The following markup structure and classnames are required. Any SVG icons can be used.

<span class="listbox-button">
  <button class="expand-btn" style="min-width: 150px" aria-expanded="false" aria-haspopup="listbox">
    <span class="expand-btn__cell">
      <span class="expand-btn__text">Option 1</span>
      <svg class="icon icon--dropdown" focusable="false" height="8" width="8" aria-hidden="true">
        <use href="icon.svg#icon-dropdown"></use>
      </svg>
    </span>
  </button>
  <div class="listbox-button__listbox">
    <div class="listbox-button__options" role="listbox" tabindex="0">
      <div class="listbox-button__option" role="option">
        <span class="listbox-button__value">Option 1</span>
        <svg class="icon icon--tick-small" focusable="false" height="8" width="8">
          <use href="icon.svg#icon-tick-small"></use>
        </svg>
      </div>
      <div class="listbox-button__option" role="option">
        <span class="listbox-button__value">Option 2</span>
        <svg class="icon icon--tick-small" focusable="false" height="8" width="8">
          <use href="icon.svg#icon-tick-small"></use>
        </svg>
      </div>
      <div class="listbox-button__option" role="option">
        <span class="listbox-button__value">Option 3</span>
        <svg class="icon icon--tick-small" focusable="false" height="8" width="8">
          <use href="icon.svg#icon-tick-small"></use>
        </svg>
      </div>
    </div>
  </div>
</span>

CSS

No CSS is provided. However, the class is fully compatible with eBay Skin.

JavaScript

import ListboxButton from "makeup-listbox-button";

document.querySelectorAll(".listbox-button").forEach(function (el, i) {
  const widget = new ListboxButton(el, config);

  el.addEventListener("makeup-listbox-button-change", function (e) {
    console.log(e.type, e.detail);
  });
});

Config

The constructor takes a configuration object as its second parameter.

todo

Events

makeup-listbox-button-change

Fired when the listbox selection is changed.

  • fromValue: the old value
  • toValue: the new value

FAQs

Package last updated on 19 Aug 2025

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