{"bugs":{"url":"https://github.com/lukeed/clsx/issues"},"dist":{"shasum":"c10abbbdaf7b3f835aa80f5492f5ca719a2f9431","tarball":"https://registry.npmjs.org/clsx/-/clsx-2.0.0-next.0.tgz","fileCount":8,"integrity":"sha512-VAK6cgkmkKhG5feiYwE5EG5Z9/IdMcpqb+O1KrTGw7cwsMvjI5FOhoGLSLNtRYJ3qbGsdV+loIcawHPPQYxyTQ==","signatures":[{"sig":"MEQCIFbWrI9CRVdW8RJy6+0/jUsrBMPL8ygDY8770K9Aexp1AiA6wOKBNpExfIrM5RWNr7sXR4Csc7wHPEiTRkHD/b4ezg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":6792},"main":"dist/clsx.js","name":"clsx","types":"clsx.d.ts","unpkg":"dist/clsx.min.js","author":{"url":"https://lukeed.com","name":"Luke Edwards","email":"luke.edwards05@gmail.com"},"module":"dist/clsx.mjs","readme":"# clsx [![CI](https://github.com/lukeed/clsx/workflows/CI/badge.svg)](https://github.com/lukeed/clsx/actions?query=workflow%3ACI) [![codecov](https://badgen.net/codecov/c/github/lukeed/clsx)](https://codecov.io/gh/lukeed/clsx)\n\n> A tiny (234B) utility for constructing `className` strings conditionally.<Br>Also serves as a [faster](/bench) & smaller drop-in replacement for the `classnames` module.\n\nThis module is available in three formats:\n\n* **ES Module**: `dist/clsx.m.js`\n* **CommonJS**: `dist/clsx.js`\n* **UMD**: `dist/clsx.min.js`\n\n\n## Install\n\n```\n$ npm install --save clsx\n```\n\n\n## Usage\n\n```js\nimport clsx from 'clsx';\n// or\nimport { clsx } from 'clsx';\n\n// Strings (variadic)\nclsx('foo', true && 'bar', 'baz');\n//=> 'foo bar baz'\n\n// Objects\nclsx({ foo:true, bar:false, baz:isTrue() });\n//=> 'foo baz'\n\n// Objects (variadic)\nclsx({ foo:true }, { bar:false }, null, { '--foobar':'hello' });\n//=> 'foo --foobar'\n\n// Arrays\nclsx(['foo', 0, false, 'bar']);\n//=> 'foo bar'\n\n// Arrays (variadic)\nclsx(['foo'], ['', 0, false, 'bar'], [['baz', [['hello'], 'there']]]);\n//=> 'foo bar baz hello there'\n\n// Kitchen sink (with nesting)\nclsx('foo', [1 && 'bar', { baz:false, bat:null }, ['hello', ['world']]], 'cya');\n//=> 'foo bar hello world cya'\n```\n\n\n## API\n\n### clsx(...input)\nReturns: `String`\n\n#### input\nType: `Mixed`\n\nThe `clsx` function can take ***any*** number of arguments, each of which can be an Object, Array, Boolean, or String.\n\n> **Important:** _Any_ falsey values are discarded!<br>Standalone Boolean values are discarded as well.\n\n```js\nclsx(true, false, '', null, undefined, 0, NaN);\n//=> ''\n```\n\n## Benchmarks\n\nFor snapshots of cross-browser results, check out the [`bench`](/bench) directory~!\n\n## Support\n\nAll versions of Node.js are supported.\n\nAll browsers that support [`Array.isArray`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/isArray#Browser_compatibility) are supported (IE9+).\n\n>**Note:** For IE8 support and older, please install `clsx@1.0.x` and beware of [#17](https://github.com/lukeed/clsx/issues/17).\n\n## Tailwind Support\n\nHere some additional (optional) steps to enable classes autocompletion using `clsx` with Tailwind CSS.\n<details>\n\n<summary>\n  Visual Studio Code\n</summary>\n\n1. [Install the \"Tailwind CSS IntelliSense\" Visual Studio Code extension](https://marketplace.visualstudio.com/items?itemName=bradlc.vscode-tailwindcss)\n\n2. Add the following to your [`settings.json`](https://code.visualstudio.com/docs/getstarted/settings):\n\n  ```json\n   {\n    \"tailwindCSS.experimental.classRegex\": [\n      [\"clsx\\\\(([^)]*)\\\\)\", \"(?:'|\\\"|`)([^']*)(?:'|\\\"|`)\"]\n    ]\n   }\n  ```\n</details>\n\n## Related\n\n- [obj-str](https://github.com/lukeed/obj-str) - A smaller (96B) and similiar utility that only works with Objects.\n\n## License\n\nMIT © [Luke Edwards](https://lukeed.com)\n","engines":{"node":">=6"},"exports":{"import":{"types":"./clsx.d.mts","default":"./dist/clsx.mjs"},"default":{"types":"./clsx.d.ts","default":"./dist/clsx.js"}},"gitHead":"23b2ced389da237b69d2091621a3baedfc55ac04","license":"MIT","scripts":{"test":"uvu -r esm test","build":"node bin"},"_npmUser":{"name":"lukeed","email":"luke@lukeed.com"},"homepage":"https://github.com/lukeed/clsx#readme","keywords":["classes","classname","classnames"],"repository":{"url":"git+https://github.com/lukeed/clsx.git","type":"git"},"_npmVersion":"8.19.2","description":"A tiny (234B) utility for constructing className strings conditionally.","directories":{},"maintainers":[{"name":"lukeed","email":"luke@lukeed.com"}],"_nodeVersion":"18.12.1","_hasShrinkwrap":false,"readmeFilename":"readme.md","devDependencies":{"esm":"3.2.25","uvu":"0.5.4","terser":"4.8.0"},"_npmOperationalInternal":{"tmp":"tmp/clsx_2.0.0-next.0_1689464146823_0.13576152705819355","host":"s3://npm-registry-packages"},"_id":"clsx@2.0.0-next.0","version":"2.0.0-next.0"}