Sha256: d1fc7fc1d28454692c490994ab8e5c9009ca9094cb2a489bb6a70bcb08f7316d

Contents?: true

Size: 396 Bytes

Versions: 11

Compression:

Stored size: 396 Bytes

Contents

// Inspired by: https://github.com/excid3/tailwindcss-stimulus-components/blob/master/src/popover.js

import { Controller } from "@hotwired/stimulus";

export default class UIToggleController extends Controller {
  connect() {}

  toggle() {
    if (this.element.dataset.state == "on") {
      this.element.dataset.state = "off";
    } else {
      this.element.dataset.state = "on";
    }
  }
}

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
shadcn-ui-0.0.15 app/javascript/controllers/ui/toggle_controller.js
shadcn-ui-0.0.14 app/javascript/controllers/ui/toggle_controller.js
shadcn-ui-0.0.13 app/javascript/controllers/ui/toggle_controller.js
shadcn-ui-0.0.12 app/javascript/controllers/ui/toggle_controller.js
shadcn-ui-0.0.10 app/javascript/controllers/ui/toggle_controller.js
shadcn-ui-0.0.8 app/javascript/controllers/ui/toggle_controller.js
shadcn-ui-0.0.5 app/javascript/controllers/ui/toggle_controller.js
shadcn-ui-0.0.4 app/javascript/controllers/ui/toggle_controller.js
shadcn-ui-0.0.3 app/javascript/controllers/ui/toggle_controller.js
shadcn-ui-0.0.2 app/javascript/controllers/ui/toggle_controller.js
shadcn-ui-0.0.1 app/javascript/controllers/ui/toggle_controller.js