treeloom-components
Ready-made treeloom building blocks: one small factory per HTML element, plus a typeahead and a clearable search box.
Three of my projects had each grown their own, slightly different copy of the same small "build a
<div>, an <input>,
a <label>" functions for treeloom.
This package is those functions brought into one place and reconciled, and a home for richer components none of them had yet.
- Base components: thin wrappers around treeloom's
createDomItem, one per real element (div,form,radio,table, ...). Compose them the way you would write the HTML. - Typeahead: type to filter a list of options; a real
<select>holds the submitted value. - Clearable input: a search box with a clear button that empties it and gives focus back.
Open source (MPL-2.0) and on npm. It's young (0.x) and grows as the apps need it: the Quizzes forms and this site's own project grid are built with it.
Try it
A form built from the typeahead and the clearable input, and what it would submit. The same sandbox is on the projects page.