Rc Switch
rc-switch
switch ui component for react
Component Libraries
react
react-component
react-switch
switch
rc-switch
Component Libraries
javascript
npm
frontend
open source
Stars
196
Weekly
1.9M
Open issues
18
Bundle
~25 kB
Installation
npm install rc-switchCode example
import { Button } from "rc-switch";
export function Example() {
return (
<div className="flex gap-2">
<Button>Primary</Button>
<Button variant="outline">Secondary</Button>
</div>
);
}Pros & cons
Pros
- Actively maintained by benjycui
- 1.9M weekly downloads. Battle tested
- First-class TypeScript definitions
- MIT licensed
Considerations
- Adds roughly ~25 kB to your bundle
- Needs client-only rendering in SSR frameworks
- Not supported in React Native
- 18 open issues on GitHub