stimulus-toggle

2.0.1 • Public • Published

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

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 2.0.1
    1
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 2.0.1
    1
  • 2.0.0
    0
  • 1.0.1
    0
  • 1.0.0
    0

Package Sidebar

Install

npm i stimulus-toggle

Weekly Downloads

1

Version

2.0.1

License

MIT

Unpacked Size

10 kB

Total Files

17

Last publish

Collaborators

  • olimart