Logo Logo Nue Package
Getting Started Introduction
Getting Started Gulp
Getting Started Customization
Getting Started Credits
Getting Started Changelog
Design & Graphics Bootstrap Icons
Design & Graphics Illustrations
Components Accordion
Components Alerts
Components Avatars
Components Badge
Components Breadcrumb
Components Buttons
Components Button group
Components Cards
Components Collapse
Components Column divider
Components Devices
Components Divider
Components Dropdowns
Components Icons
Components List Group
Components Lists
Components Legend Indicator
Components Modal
Components Offcanvas
Components Page Header
Components Pagination
Components Popovers
Components Progress
Components Profile
Components Shapes
Components Sliding Image
Components Spinners
Components Steps
Components Tab
Components Toasts
Components Tooltips
Components Typography
Navbars Navbar
Navbars Navs
Navbars Mega Menu
Navbars Navbar Vertical Aside
Navbars Scrollspy
Tables Tables
Tables Datatables
Tables Sticky Header
Basic forms Basic forms
Basic forms Checks and switches
Basic forms Input group
Utilities Backgrounds
Utilities Borders
Utilities Colors
Utilities Links
Utilities Position
Utilities Rotations
Utilities Shadows
Utilities Sizing
Utilities Spacing
Utilities Z-index
Utilities Opacity
Advanced forms Advanced select
Advanced forms Datepicker
Advanced forms Date Range Picker
Advanced forms Calendar (Fullcalendar)
Advanced forms File attachments
Advanced forms Drag’ n’ drop file uploads
Advanced forms WYSIWYG Editor
Advanced forms Quantity counter
Advanced forms Copy to Clipboard
Advanced forms Input mask
Advanced forms Step forms (Wizards)
Advanced forms Wizards
Advanced forms Add field
Advanced forms Toggle password
Advanced forms Count characters
Advanced forms Form Search
Advanced forms Toggle switch
Advanced forms Google reCAPTCHA
Others Chart.js
Others Counter
Others Circles.js (Pie Chart)
Others Fullscreen Lightbox
Others Leaflet
Others JSVectorMap
Others SortableJS
Others Sticky block
Others Go To

No Results

  • Preview Demo
Logo Nµe
  • Nue
  • UI (HTML)
  • Getting Started
  • Introduction
  • Credits
  • Design & Graphics
  • Bootstrap Icons
  • Iconify Design
  • Illustrations
  • Components
  • Accordion
  • Alerts
  • Avatars
  • Badge
  • Breadcrumb
  • Buttons
  • Button Group
  • Cards
  • Collapse
  • Column Divider
  • Devices
  • Divider
  • Dropdowns
  • Icons
  • List Group
  • Lists
  • Legend Indicator
  • Modal
  • Offcanvas
  • Page Header
  • Pagination
  • Popovers
  • Progress
  • Profile
  • Shapes
  • Sliding Image
  • Spinners
  • Steps
  • Tab
  • Toasts
  • Tooltips
  • Typography
  • Navbars
  • Navbar
  • Navs
  • Mega Menu
  • Navbar Vertical Aside
  • Scrollspy
  • Tables
  • Tables
  • Datatables
  • Sticky Header
  • Basic Forms
  • Basic Forms
  • Checks & Switches
  • Input Group
  • Advanced Forms
  • Advanced Select
  • Datepicker (Flatpickr)
  • Date Range Picker
  • Calendar (Fullcalendar)
  • File Attachments
  • Drag n' Drop Uploads
  • WYSIWYG Editor
  • Quantity Counter
  • Copy to Clipboard
  • Input Mask
  • Step Forms (Wizards)
  • Add Field
  • Toggle Password
  • Count Characters
  • Form Search
  • Toggle Switch
  • Google reCAPTCHA
  • Charts
  • Chart.js
  • Counter
  • Circles.js (Pie Chart)
  • Others
  • Fullscreen Lightbox
  • Leaflet
  • JSVectorMap
  • SortableJS
  • Sticky Block
  • Go To
  • Utility
  • Backgrounds
  • Borders
  • Colors
  • Links
  • Position
  • Shadows
  • Sizing
  • Spacing
  • Z-Index
  • Opacity

Toggle Switch

Cara Pakai

Copy-paste script berikut sebelum tag penutup <body>:

    
      <script>
        (function() {
          // INITIALIZATION OF TOGGLE SWITCH
          // =======================================================
          new NueToggleSwitch('.js-toggle-switch')
        });
      </script>
    
  

  • Preview
  • HTML

19

39

59

        
          <!-- Form Switch -->
          <div class="d-flex justify-content-center mb-4">
            <div class="form-check form-switch form-switch-between">
              <label class="form-check-label">Monthly</label>
              <input class="js-toggle-switch form-check-input" type="checkbox"
                     data-nue-toggle-switch-options='{
                       "targetSelector": "#pricingCount1, #pricingCount2, #pricingCount3"
                     }'>
              <label class="form-check-label">Annually</label>
            </div>
          </div>
          <!-- End Form Switch -->

          <div class="row justify-content-center">
            <div class="col-md-3 mb-3 mb-md-0">
              <h2 id="pricingCount1" class="display-4 text-center"
                     data-nue-toggle-switch-item-options='{
                       "min": 19,
                       "max": 29
                     }'>19</h2>
            </div>
            <!-- End Col -->

            <div class="col-md-3 mb-3 mb-md-0">
              <h2 id="pricingCount2" class="display-4 text-center"
                     data-nue-toggle-switch-item-options='{
                       "min": 39,
                       "max": 49
                     }'>39</h2>
            </div>
            <!-- End Col -->

            <div class="col-md-3 mb-3 mb-md-0">
              <h2 id="pricingCount3" class="display-4 text-center"
                     data-nue-toggle-switch-item-options='{
                       "min": 59,
                       "max": 69
                     }'>59</h2>
            </div>
            <!-- End Col -->
          </div>
          <!-- End Row -->
        
      

Pakai Modal

  • Preview
  • HTML
Toggle Switch

19

39

59

        
          <button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#exampleModal">Open modal</button>

          <!-- Modal -->
          <div class="modal fade" id="exampleModal" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
            <div class="modal-dialog">
              <div class="modal-content">
                <div class="modal-header">
                  <h5 class="modal-title" id="exampleModalLabel">Toggle Switch</h5>
                  <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Tutup"></button>
                </div>

                <div class="modal-body">
                  <form>
                    <!-- Form Switch -->
                    <div class="d-flex justify-content-center mb-4">
                      <div class="form-check form-switch form-switch-between">
                        <label class="form-check-label">Monthly</label>
                        <input class="js-toggle-switch form-check-input" type="checkbox"
                               data-nue-toggle-switch-options='{
                                 "targetSelector": "#pricingCountModal1, #pricingCountModal2, #pricingCountModal3"
                               }'>
                        <label class="form-check-label">Annually</label>
                      </div>
                    </div>
                    <!-- End Form Switch -->

                    <div class="row justify-content-center">
                      <div class="col-md-3 mb-3 mb-md-0">
                        <h2 id="pricingCountModal1" class="display-4 text-center"
                               data-nue-toggle-switch-item-options='{
                                 "min": 19,
                                 "max": 29
                               }'>19</h2>
                      </div>
                      <!-- End Col -->

                      <div class="col-md-3 mb-3 mb-md-0">
                        <h2 id="pricingCountModal2" class="display-4 text-center"
                               data-nue-toggle-switch-item-options='{
                                 "min": 39,
                                 "max": 49
                               }'>39</h2>
                      </div>
                      <!-- End Col -->

                      <div class="col-md-3 mb-3 mb-md-0">
                        <h2 id="pricingCountModal3" class="display-4 text-center"
                               data-nue-toggle-switch-item-options='{
                                 "min": 59,
                                 "max": 69
                               }'>59</h2>
                      </div>
                      <!-- End Col -->
                    </div>
                    <!-- End Row -->
                  </form>
                </div>

                <div class="modal-footer">
                  <button type="button" class="btn btn-white" data-bs-dismiss="modal">Tutup</button>
                  <button type="button" class="btn btn-primary">Simpan</button>
                </div>
              </div>
            </div>
          </div>
          <!-- End Modal -->
        
      

Methods

ParameterDeskripsiNilai default

targetSelector

Target Class yang ingin nilainya berubah dari min ke max dengan animasi (perhitungan), untuk setiap element yang ditentukan dalam bentuk array. Intinya, menampilkan hitungan naik/turun.undefined

isChecked

true bisa digunakan supaya target otomatis aktif ketika pertama kali di load.false

eventType

Event untuk menjalankan script.'change'

min

Nilai awal.-

max

Nilai maksimal.-