Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

easy-toggle-state

Package Overview
Dependencies
Maintainers
1
Versions
50
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

easy-toggle-state

A tiny JavaScript library to easily toggle the state of any HTML element in any contexts, and create UI components in no time.

  • 1.16.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Easy Toggle State

A tiny JavaScript library to easily toggle the state of any HTML element in any contexts, and create UI components in no time.

Dropdown, navigation button, tooltip, collapsible panel, lightbox, tabs, switches… UI components made in minutes without worried about JavaScript. Only set a few HTML attributes, and code the rest with your CSS skills.

See some examples in the documentation.

Status

GitHub release (latest by date) npm Cdnjs npm bundle size npm bundle size

David David

Why?

A front-end developer often has to code scripts for interface components. Components such as drop-downs, navigation buttons, tooltips, expandable panels, lightboxes, tabs, etc.

The thing is… Most of these components expose a recurrent behavior: a trigger element toggles the state of one or more target elements. So why not code this behavior once and for all?

So here is a solution: a simple script to toggle the state of a trigger element with a CSS class. You can then associate this element with one or more others: let's call them targets. By adding the right HTML attributes, it can adapt to any contexts and behave like a chosen component.

Only focus on adjusting the rest with your CSS creativity.

Quick start

Several quick start options are available:

  • Direct download
  • Choose another version: ES5 or ES6
  • Link from cdnjs
  • Install with npm: npm install easy-toggle-state

Documentation

Easy Toggle State's full documentation is hosted on GitHub Pages at twikito.github.io/easy-toggle-state/.

Contribution

License

MIT. Copyright (c) Matthieu Bué

Keywords

FAQs

Package last updated on 30 Dec 2020

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc