@rightui/switch
An unstyled, lightweight, keyboard-friendly switch component for your React app.
Installation
yarn add @rightui/switch
npm i @rightui/switch
Usage
import Switch from '@rightui/switch';
const [isChecked, setIsChecked] = useState(false);
const App = () => (
<Switch
label='Enable Notifications'
checked={isChecked}
onChecked={(checked) => setIsChecked(checked)}
/>
);
Documentation
Example
Checkout the component in Sandbox.
Accessibility
Follows the WAI-ARIA Authoring Practices.