2.0.1 • Published 3 years ago

stimulus-toggle v2.0.1

Weekly downloads
3
License
MIT
Repository
github
Last release
3 years ago

Stimulus toggle controller

Installation

  1. Add package yarn add stimulus-toggle
  2. Import package in your application
import { Application } from 'stimulus'
const application = Application.start()

import ToggleController from 'stimulus-toggle'
application.register('toggle', ToggleController)

Configuration

<div data-controller="toggle"
     data-toggle-hidden-class="hidden"> <!-- optional -->
.hidden { display: none; }

Example

<div data-controller="toggle">
  <button data-action="click->toggle#toggle">Toggle</button>  
  <div data-toggle-target="toggleable">
    This should be toggled on click.
  </div>
</div>

Publish new version

  1. Run yarn build
  2. Update CHANGELOG.md
  3. Run yarn publish
2.0.1

3 years ago

2.0.0

3 years ago

1.0.1

4 years ago

1.0.0

4 years ago