Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/rajasegar/css-toggle-component

Pure CSS Toggle Buttons as a Web component
https://github.com/rajasegar/css-toggle-component

toggle toggle-buttons toggle-switches togglebutton webcomponent webcomponents

Last synced: 23 days ago
JSON representation

Pure CSS Toggle Buttons as a Web component

Awesome Lists containing this project

README

        

[![npm version](http://img.shields.io/npm/v/css-toggle-component.svg?style=flat)](https://npmjs.org/package/css-toggle-component "View this project on npm")
[![dependencies Status](https://david-dm.org/rajasegar/css-toggle-component/status.svg)](https://david-dm.org/rajasegar/css-toggle-component)
[![devDependencies Status](https://david-dm.org/rajasegar/css-toggle-component/dev-status.svg)](https://david-dm.org/rajasegar/css-toggle-component?type=dev)

# Pure CSS Toggle Web component
Pure CSS Toggle Buttons - ON-OFF Switches

- 16 different style effects to choose from
- Keyboard Accessible (You can able to toggle using Space keys)
- Screenreader discoverability

## Install
npm install css-toggle-component

## Demo
https://rajasegar.github.io/css-toggle-component

## Usage

```html

```

## Themes
Pass on any one of the following values for different toggle effects to `theme` property.

- slide
- move
- updown
- flip
- rotate
- fadeout
- slideall
- rect-slide
- rect-flip
- rect-move
- rect-hide
- rect-updown
- rect-zoomin
- rect-slide2
- rect-slide3
- rect-slide4

## Things to do
- Bring focus to the component when using Tab keys for navigation
- Provide option to pass on aria-label
- Tests
- Refactoring and code cleanup
- And much more...

## Credits
https://codepen.io/himalayasingh/pen/EdVzNL?editors=1000

A Pen by Himalaya Singh