Coder Social home page Coder Social logo

tiliaks / easy-toggle-state Goto Github PK

View Code? Open in Web Editor NEW

This project forked from twikito/easy-toggle-state

0.0 2.0 0.0 729 KB

A tiny JavaScript library to easily toggle the state of any HTML element in any contexts.

Home Page: https://twikito.github.io/easy-toggle-state/

License: MIT License

JavaScript 100.00%

easy-toggle-state's Introduction

Easy Toggle State

A tiny JavaScript library to easily toggle the state of any HTML element and its targets.

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

npm version dependencies Status devDependencies Status code style: prettier contributions welcome GitHub license

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:

Then, add the script into your page, and it's done.

Documentation

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

Contribution

License

MIT. Copyright (c) Matthieu Bué

easy-toggle-state's People

Contributors

twikito avatar dhoko avatar borisschapira avatar

Watchers

James Cloos avatar Sergey avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.