New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

toggle-button

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

toggle-button

A toggle button for simple web demos

latest
Source
npmnpm
Version
1.0.1
Version published
Weekly downloads
20
42.86%
Maintainers
1
Weekly downloads
 
Created
Source

toggle-button

This module provides a very simple toggled button for your demos and prototypes up and running.Ideal for use with Beefy.

api

toggleButton([onClick], [options])

[onClick] receives 2 parameters:

  • button: a DOM element for the toggled button.
  • stopped: current status, true or false.

Example:

var toggleButton = require('toggle-button');

toggleButton(function(button, stopped) {
    console.log('stopped', stopped);
});

with options:

toggleButton(function(button, stopped){
    console.log('stopped', stopped);
}, {
    toBottom: 10,
    toRight: 10,
    width: 100,
    height: 100,
    startedCaption: 'Running Now',
    stoppedCaption: 'Waiting Now'
});

and you can inject your own buttom element:

domready(function() {
    var button = document.createElement('button');
    button.type = 'button';
    document.body.appendChild(button);

    toggleButton(function(button, stopped){
        console.log('stopped', stopped);
    }, {
        button: button
    });
});

testing with beefy

First install beefy:

npm i beefy -g

Then run the demo:

beefy demo/demo.js --live

And open up localhost:9966 in your browser.

Keywords

toggle

FAQs

Package last updated on 11 Feb 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts