Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

classwrap

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

classwrap - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

4

package.json
{
"name": "classwrap",
"description": "320B JavaScript function for conditionally concatenating classNames.",
"version": "1.0.0",
"description": "0.3 KB JavaScript utility for conditionally concatenating class names.",
"version": "1.0.1",
"main": "dist/classwrap.js",

@@ -6,0 +6,0 @@ "jsnext:main": "src/index.js",

@@ -6,3 +6,3 @@ # Classwrap

Classwrap is a (340B) JavaScript function for conditionally concatenating [class names](https://developer.mozilla.org/en-US/docs/Web/API/Element/className).
Classwrap 0.3 KB JavaScript utility for conditionally concatenating [class names](https://developer.mozilla.org/en-US/docs/Web/API/Element/className).

@@ -12,12 +12,21 @@ [Try it Online](https://codepen.io/jbucaran/pen/GMRjRB)

```js
function HelloButton({ active, label }) {
const name = classwrap([
"btn",
"btn-large",
{
"btn-active": active
}
])
return <button class={name}>{label}</button>
function ToggleButton({ toggle, isOn }) {
return (
<div class="btn" onclick={toggle}>
<div
class={classwrap({
circle: true,
off: !isOn,
on: isOn
})}
/>
<span
class={classwrap({
textOff: !isOn
})}
>
{isOn ? "ON" : "OFF"}
</span>
</div>
)
}

@@ -28,2 +37,6 @@ ```

![Classwrap](https://user-images.githubusercontent.com/56996/30416101-cda83bd4-9965-11e7-9db5-230ba3fc83fd.gif)
## Installation

@@ -30,0 +43,0 @@

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc