UNPKG

@kubit-ui-web/react-components

Version:

Kubit React Components is a customizable, accessible library of React web components, designed to enhance your application's user experience

14 lines 395 B
import { useState } from 'react'; export const useCheckbox = ({ initialChecked, disabled }) => { const [isChecked, setIsChecked] = useState(initialChecked); const handleToggleIsChecked = () => { if (!disabled) { setIsChecked(!isChecked); } }; return { isChecked, handleToggleIsChecked, }; }; //# sourceMappingURL=useCheckbox.js.map