/

Toggle


The toggle is a component similar to checkbox and can be used to determine user preferences.

import { useState } from 'react'
import { Toggle } from 'insites-ui'

// Inside component
const [isToggled, setIsToggled] = useState(false)
const toggle = () => setIsToggled(!isToggled)

<Toggle
  id="notifications"
  checked={isToggled}
  onChange={toggle}
>
  Receive notifications
</Toggle>
Edit on GitHub