🚀 Socket Launch Week 🚀 Day 5: Introducing Socket Fix.Learn More
Socket
Sign inDemoInstall
Socket

@radix-ui/react-switch

Package Overview
Dependencies
Maintainers
6
Versions
216
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@radix-ui/react-switch - npm Package Compare versions

Comparing version

to
1.1.5-rc.1744259191780

LICENSE

11

dist/index.js

@@ -31,3 +31,3 @@ "use strict";

// packages/react/switch/src/index.ts
// src/index.ts
var index_exports = {};

@@ -43,3 +43,3 @@ __export(index_exports, {

// packages/react/switch/src/switch.tsx
// src/switch.tsx
var React = __toESM(require("react"));

@@ -75,6 +75,7 @@ var import_primitive = require("@radix-ui/primitive");

const isFormControl = button ? form || !!button.closest("form") : true;
const [checked = false, setChecked] = (0, import_react_use_controllable_state.useControllableState)({
const [checked, setChecked] = (0, import_react_use_controllable_state.useControllableState)({
prop: checkedProp,
defaultProp: defaultChecked,
onChange: onCheckedChange
defaultProp: defaultChecked ?? false,
onChange: onCheckedChange,
caller: SWITCH_NAME
});

@@ -81,0 +82,0 @@ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(SwitchProvider, { scope: __scopeSwitch, checked, disabled, children: [

{
"name": "@radix-ui/react-switch",
"version": "1.1.4",
"version": "1.1.5-rc.1744259191780",
"license": "MIT",

@@ -8,19 +8,2 @@ "source": "./src/index.ts",

"module": "./dist/index.mjs",
"publishConfig": {
"main": "./dist/index.js",
"module": "./dist/index.mjs",
"types": "./dist/index.d.ts",
"exports": {
".": {
"import": {
"types": "./dist/index.d.mts",
"default": "./dist/index.mjs"
},
"require": {
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
}
}
}
},
"files": [

@@ -31,13 +14,8 @@ "dist",

"sideEffects": false,
"scripts": {
"lint": "eslint --max-warnings 0 src",
"clean": "rm -rf dist",
"version": "yarn version"
},
"dependencies": {
"@radix-ui/primitive": "1.1.2",
"@radix-ui/react-context": "1.1.2",
"@radix-ui/react-compose-refs": "1.1.2",
"@radix-ui/react-context": "1.1.2",
"@radix-ui/react-use-controllable-state": "1.2.0-rc.1744259191780",
"@radix-ui/react-primitive": "2.0.3",
"@radix-ui/react-use-controllable-state": "1.1.1",
"@radix-ui/react-use-previous": "1.1.1",

@@ -47,4 +25,2 @@ "@radix-ui/react-use-size": "1.1.1"

"devDependencies": {
"@repo/eslint-config": "0.0.0",
"@repo/typescript-config": "0.0.0",
"@types/react": "^19.0.7",

@@ -55,3 +31,6 @@ "@types/react-dom": "^19.0.3",

"react-dom": "^19.0.0",
"typescript": "^5.7.3"
"typescript": "^5.7.3",
"@repo/builder": "0.0.0",
"@repo/eslint-config": "0.0.0",
"@repo/typescript-config": "0.0.0"
},

@@ -80,2 +59,9 @@ "peerDependencies": {

},
"scripts": {
"lint": "eslint --max-warnings 0 src",
"clean": "rm -rf dist",
"typecheck": "tsc --noEmit",
"build": "radix-build"
},
"types": "./dist/index.d.ts",
"exports": {

@@ -92,4 +78,3 @@ ".": {

}
},
"types": "./dist/index.d.ts"
}
}
# `react-switch`
## Installation
```sh
$ yarn add @radix-ui/react-switch
# or
$ npm install @radix-ui/react-switch
```
## Usage
View docs [here](https://radix-ui.com/primitives/docs/components/switch).

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet