@renderlesskit/react
Version:
Collection of headless components/hooks that are accessible, composable, customizable from low level to build your own UI & Design System powered by Reakit
20 lines • 562 B
JavaScript
import { useControllableState } from "../utils/index";
export function useCheckboxState() {
var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
var {
// Default State should be false otherwise input state will be undefined
defaultState = false,
state: stateProp,
onStateChange
} = props;
var [state, setState] = useControllableState({
defaultValue: defaultState,
value: stateProp,
onChange: onStateChange
});
return {
state,
setState
};
}
//# sourceMappingURL=CheckboxState.js.map