@raddix/switch
v1.0.6
Published
Is a hook that provides the behavior and accessibility of a switch.
Downloads
66
Maintainers
Readme
Features
- Full support for browser features.
- Accessible to screen reader and keyboard navigation.
- Doesn’t implement any rendering or impose a DOM structure, unstyled.
- Fully-typed API
Installation
Install the primitive from your command line.
yarn add @raddix/switch
#or
pnpm add @raddix/switch
Usage
This is a simple example of how to use it. To see the options and more modes of use here.
import { useSwitch } from '@raddix/switch';
import './styles.scss';
const Switch = props => {
const { switchProps } = useSwitch(props);
return <div {...switchProps} className='switch'></div>;
};