Have ideas to improve npm?Join in the discussion! »

    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

    Keywords

    none

    Install

    npm i stimulus-toggle

    DownloadsWeekly Downloads

    12

    Version

    2.0.1

    License

    MIT

    Unpacked Size

    10 kB

    Total Files

    17

    Last publish

    Collaborators

    • avatar