Skip to content

component/more

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

more

Expand and collapse lists.

Installation

$ component install component/more

Example

var more = require('more');
var list = document.querySelector('ul');

more(list)
  .max(5)
  .more('Show more')
  .less('Show less')
  .render();

API

More#max(n)

Change max number of list items shown when collapsed, defaults to 5.

More#more(label)

Change label from default of "More".

More#less(label)

Change label from default of "Less".

More#render()

Render the list, adds the appropriate more / less link depending on the state.

More#expand()

Expand the list and re-render.

More#collapse()

Collapse the list and re-render.

More#state

String representing the state. Either "expanded", or "collapsed".

License

MIT

About

Expand and collapse lists

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published