2.0.1 • Published 6 years ago

choo-tags-input v2.0.1

Weekly downloads
-
License
MIT
Repository
-
Last release
6 years ago

Choo Tags Input

Installation

npm install -S choo-tags-input

Usage

const html = require('choo/html')
const TagsInputComponent = require('choo-tags-input')

module.exports = FormComponent

const tagInput = TagsInputComponent('customInputId', 'customInputName', onTagsChange(emit))

function FormComponent(state, emit) {
  return html`
    <form>
      <div class="form-group">
        <label for="customInputId">Input label</label>
        ${ tagInput.render(state.tags) }
      </div>
    </form>
  `
}

// Change handler (for adding or removing tags)
function onTagsChange(emit) {
  return function (inputName, values) {
    emit('<eventName>', inputName, values)
  }
}

License

MIT

2.0.1

6 years ago

2.0.0

6 years ago

1.1.0

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago