control-brick
Lego plugin to toggle or radio any dom elements. Useful to create tab-based navigation bar, toolbar, etc.
Installation
with component:
$ component install bredele/control-brick
with nodejs:
$ component install control-brick
Usage
First, add the plugin to your view (see lego to know more about views):
var controller = { //do something };view;
Basic
radio:
Menu 1 Menu 2
Add active
class to the clicked button (with the class menu
).
Only one button can be 'active' at a time.
toggle:
Toggle active
class to the clicked link (with the class link
).
Serveral links can be 'active' at the same time.
Control
uses events-brick and inherits its behaviour.
see live example
Advanced
You can change the class applied to your radio/toggle elements (active
is the default class):
Menu 1 Menu 2
Add clicked
class to the clicked button
License
MIT