collapsable-component

Click to toggle data in collapsable list. Depends on jQuery.

usage

// keys for nested objects will be rendered as collapsables. Other values are ignored and rendered as a list item.
var data = {
  'Quality': {
    'increase quality': {
      'tomorrow' : null
    }
  },
  'Efficiancy': {
    'be faster': null
  },
  'Delivery': null
};
// constructor(Object, rootElementId)
// rootElementId needs to be present in the DOM
var collapsable = new Collapsable(data, 'root');

demo

demo with some optional styling.

TODOs

  • pass obj as data
  • only add icon on collapsables
  • moar component style
  • option to set some styling
  • remove jQuery and add some vue.js magic?

licence

MIT