o-toggle

Accessible show/hide behaviour

active

Toggles

The toggle button updates aria attributes on the targets and adds a class.

<button class="demo-toggle" data-o-component="o-toggle" data-o-toggle-target=".demo-target" data-o-toggle-callback="document.querySelector(&apos;.demo-target&apos;).classList.toggle(&apos;hidden&apos;);">Toggle</button>

<div class="demo-target hidden">Target of the toggle</div>
GitHub Repository

Quickstart

Build Service

Add the following to your <script> tag

o-toggle@^1.1.7

How do I do that?

For more information see the Origami build service.

Manual Build Process

Run the following command in the root directory of your project, to add this dependency to your bower.json file:

bower install --save "o-toggle"@"^1.1.7"

For more information see the Origami build process.