Sha256: 353514dd161a4ba353078416c31095efa53f8f48b223909f4eaeef9cf1311441

Contents?: true

Size: 841 Bytes

Versions: 83

Compression:

Stored size: 841 Bytes

Contents

// @flow

import React, { useState } from 'react'
import { Toggle } from '../../'

const Example = () => {
  const [toggle1, setToggle1] = useState(false)
  const [toggle2, setToggle2] = useState(false)

  return (
    <>
      <Toggle
          checked={toggle1}
          name="toggle1"
          onChange={(event) => setToggle1(event.target.value)}
          onCheck={(event) => alert(`${event.target.name} checked!`)}
          onUncheck={(event) => alert(`${event.target.name} unchecked!`)}
      />

      <br />

      <Toggle
          checked={toggle2}
          name="toggle2"
          onChange={(event) => setToggle2(event.target.value)}
          onCheck={(event) => alert(`${event.target.name} checked!`)}
          onUncheck={(event) => alert(`${event.target.name} unchecked!`)}
      />
    </>
  )
}

export default Example

Version data entries

83 entries across 83 versions & 1 rubygems

Version Path
playbook_ui-6.0.1.pre.alpha6 app/pb_kits/playbook/pb_toggle/docs/_toggle_default.jsx
playbook_ui-6.0.1.pre.alpha5 app/pb_kits/playbook/pb_toggle/docs/_toggle_default.jsx
playbook_ui-6.0.1.pre.alpha4 app/pb_kits/playbook/pb_toggle/docs/_toggle_default.jsx
playbook_ui-6.0.1.pre.alpha3 app/pb_kits/playbook/pb_toggle/docs/_toggle_default.jsx
playbook_ui-6.0.1.pre.alpha2 app/pb_kits/playbook/pb_toggle/docs/_toggle_default.jsx
playbook_ui-5.2.0.pre.alpha15 app/pb_kits/playbook/pb_toggle/docs/_toggle_default.jsx
playbook_ui-5.2.0.pre.alpha14 app/pb_kits/playbook/pb_toggle/docs/_toggle_default.jsx
playbook_ui-5.2.0.pre.alpha13 app/pb_kits/playbook/pb_toggle/docs/_toggle_default.jsx
playbook_ui-6.0.1 app/pb_kits/playbook/pb_toggle/docs/_toggle_default.jsx
playbook_ui-5.2.0.pre.alpha12 app/pb_kits/playbook/pb_toggle/docs/_toggle_default.jsx
playbook_ui-6.0.0 app/pb_kits/playbook/pb_toggle/docs/_toggle_default.jsx
playbook_ui-5.2.0.pre.alpha11 app/pb_kits/playbook/pb_toggle/docs/_toggle_default.jsx
playbook_ui-5.5.1.pre.alpha4 app/pb_kits/playbook/pb_toggle/docs/_toggle_default.jsx
playbook_ui-5.5.1.pre.alpha3 app/pb_kits/playbook/pb_toggle/docs/_toggle_default.jsx
playbook_ui-5.5.1.pre.alpha2 app/pb_kits/playbook/pb_toggle/docs/_toggle_default.jsx
playbook_ui-5.5.1.pre.alpha1 app/pb_kits/playbook/pb_toggle/docs/_toggle_default.jsx
playbook_ui-5.2.0.pre.alpha10 app/pb_kits/playbook/pb_toggle/docs/_toggle_default.jsx
playbook_ui-5.5.1 app/pb_kits/playbook/pb_toggle/docs/_toggle_default.jsx
playbook_ui-5.5.0 app/pb_kits/playbook/pb_toggle/docs/_toggle_default.jsx
playbook_ui-5.5.0.pre.alpha1 app/pb_kits/playbook/pb_toggle/docs/_toggle_default.jsx