🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Sign inDemoInstall
Socket

@radix-ui/react-toggle

Package Overview
Dependencies
Maintainers
6
Versions
213
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

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

Comparing version

to
1.1.4-rc.1744259191780

LICENSE

11

dist/index.js

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

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

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

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

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

var Toggle = React.forwardRef((props, forwardedRef) => {
const { pressed: pressedProp, defaultPressed = false, onPressedChange, ...buttonProps } = props;
const [pressed = false, setPressed] = (0, import_react_use_controllable_state.useControllableState)({
const { pressed: pressedProp, defaultPressed, onPressedChange, ...buttonProps } = props;
const [pressed, setPressed] = (0, import_react_use_controllable_state.useControllableState)({
prop: pressedProp,
onChange: onPressedChange,
defaultProp: defaultPressed
defaultProp: defaultPressed ?? false,
caller: NAME
});

@@ -56,0 +57,0 @@ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(

{
"name": "@radix-ui/react-toggle",
"version": "1.1.3",
"version": "1.1.4-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,15 +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-primitive": "2.0.3",
"@radix-ui/react-use-controllable-state": "1.1.1"
"@radix-ui/react-use-controllable-state": "1.2.0-rc.1744259191780"
},
"devDependencies": {
"@repo/eslint-config": "0.0.0",
"@repo/typescript-config": "0.0.0",
"@types/react": "^19.0.7",

@@ -50,3 +26,6 @@ "@types/react-dom": "^19.0.3",

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

@@ -75,2 +54,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": {

@@ -87,4 +73,3 @@ ".": {

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

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