New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

ac-box

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

ac-box

no-dependency autocomplete + combobox UI library

  • 0.2.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

ac-box

travis-ci npm-version

no-dependency, lightweight autocomplete combobox UI library (demo)

short usage:

var inputEl = document.querySelector('input'),
    acbox = new AcBox(inputEl)

acbox.setMenus([
  'Alice',
  'Bob',
  'Carol'
])

Installation

Node

npm install ac-box
var AcBox = require('ac-box')

When using with Browserify, babelily and babel-preset-es2015 are required.

Browser

Download via npm or releases and load standalone build version dist/ac-box.js

<script src="ac-box/dist/ac-box.js"></script>
<script>
  var inputEl = document.querySelector('input'),
      acbox = new AcBox(inputEl)
</script>

Styling

Position related CSS properties will be configured automatically.

On the other hand, decoration related properties like border or background-color will not be configured automatically, so we have to configure CSS for menu container element or menu elements, etc. see source of demo

API

new AcBox(inputEl[, options])

Make specified inputEl to autocomplete combobox. inputEl need to be HTMLInputElement.

options need to be object and following property are available:

  • {array.<string>} menus - Menus for suggestions. Default value is []. Menus must be array of string like ['Alice', 'Bob', 'Carol'].

  • {string} menuContainerClass - Class name for menus container element. Default value is ac-menu-container.

  • {string} menuClass - Class name for each menu element. Default value is ac-menu.

  • {string} deleterClass - Class name for delete button. Default value is ac-deleter

  • {string} expanderClass - Class name for expand/collaspe button. Default value is ac-expander

AcBox#setMenus(menus)

Reset menus with specified menus.

  • {array.<string>} menus

AcBox#destroy()

Destroy DOM elements and inner objects related to ac-box.

License

MIT (c) keik

Keywords

FAQs

Package last updated on 11 Mar 2016

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