hypercombo

0.1.2 • Public • Published

hypercombo

[combo box][]: a select menu that turns into a text input if you want to choose an option that is not in the list.

Example

var combo = require('hypercombo')
var h = require('hyperscript')
var pull = require('pull-stream')

var box = combo({
  style: {width: '20ex'},
  placeholder: 'things:',
  default: 'nice thing',
  onchange: function () {
    console.log('new value:', this.value)
  },
  options: pull.values([
    h('option', {value: 'a thing'}, 'A thing'),
    h('option', {value: 'nice thing'}, 'A nice thing'),
    h('option', {value: 'other thing'}, 'Another thing')
  ])
})

document.body.appendChild(box)

License

Copyright (C) 2016 Charles Lehner

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

Readme

Keywords

none

Package Sidebar

Install

npm i hypercombo

Weekly Downloads

1

Version

0.1.2

License

GPL-3.0+

Last publish

Collaborators

  • cel
  • dominictarr
  • mixmix