Skip to content

joshwaaaah/jh-toggle-web-component

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Accessible Accordian

A simple, accessible, light-weight Web component written in pure JavaScript, allowing the easy creation of accordion-type components. Use one of our themes or apply your own. It's your choice!

Installation

Install via NPM

npm install @jhwc/accessible-accordian-web-component

Import it into your JavaScript

import "@jhwc/accessible-accordian-web-component"

Usage

The component comes in three variants, which can be enabled using the following attributes respectively: default, bbc and simply, no attribute (no styling will be applied).

<jhwc-accordian default>
    <span class="toggle-box__title" slot="title">
        I am a nice neat title! (click me to toggle the box)
    </span>
    <div class="toggle-box__content" slot="content">
        Here is some toggle-able content!
    </div>
</jhwc-accordian>

jhwc-accordian component

<jhwc-accordian bbc>
    <span class="toggle-box__title" slot="title">
        I am a nice neat title! (click me to toggle the box)
    </span>
    <div class="toggle-box__content" slot="content">
        Here is some toggle-able content!
    </div>
</jhwc-accordian>

jhwc-accordian component

<jhwc-accordian>
    <span class="toggle-box__title" slot="title">
        I am a nice neat title! (click me to toggle the box)
    </span>
    <div class="toggle-box__content" slot="content">
        Here is some toggle-able content!
    </div>
</jhwc-accordian>

Requirements

  • ES6 import
  • Nothing!

About

A simple Web component written in pure JS

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published