Socket
Book a DemoInstallSign in
Socket

@raddix/switch

Package Overview
Dependencies
Maintainers
0
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@raddix/switch

Is a hook that provides the behavior and accessibility of a switch.

latest
Source
npmnpm
Version
1.1.0
Version published
Maintainers
0
Created
Source

useSwitch

npm bundle size npm

@raddix/switch is a hook that provides the behavior for a switch component.

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>;
};

Keywords

raddix

FAQs

Package last updated on 06 Jul 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts