{"_id":"@cjser/sindresorhus__class-names","name":"@cjser/sindresorhus__class-names","dist-tags":{"latest":"2.0.0-cjser.2"},"versions":{"2.0.0-cjser.2":{"name":"@cjser/sindresorhus__class-names","version":"2.0.0-cjser.2","description":"Conditionally join CSS class names together - Especially useful with React","license":"MIT","repository":{"type":"git","url":"https://code.moenext.com/3rdeye/cjser.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"type":"module","exports":{"require":"./dist-cjser/index.cjs","default":"./index.js"},"engines":{"node":">=12"},"scripts":{"test":"xo && ava && tsd"},"keywords":["class-names","classnames","class","names","name","classes","react","jsx","component","join","concatenate","concat"],"devDependencies":{"ava":"^3.15.0","tsd":"^0.14.0","xo":"^0.39.1"},"main":"./dist-cjser/index.cjs","cjser":{"sourceVersion":"2.0.0","cjserVersion":2,"original":{"name":"@sindresorhus/class-names","version":"2.0.0","exports":"./index.js","repository":"sindresorhus/class-names","files":["index.js","index.d.ts"],"scripts":{"test":"xo && ava && tsd"}}},"_id":"@cjser/sindresorhus__class-names@2.0.0-cjser.2","gitHead":"a4bef54d7d22d3d9a6b84528457938d84cd65fe7","_nodeVersion":"20.14.0","_npmVersion":"10.7.0","dist":{"integrity":"sha512-oWwbvVdTV31GYLvS24YESqOJIsYMURZWs23skU13Gh/URduWj7j5g6KlraFLmqLkLT597lUOW5nygj0NiPufEw==","shasum":"126a32eb939c639595a5fd9a730138ebb352aa2e","tarball":"https://registry.npmjs.org/@cjser/sindresorhus__class-names/-/sindresorhus__class-names-2.0.0-cjser.2.tgz","fileCount":6,"unpackedSize":7355,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCt9vyC0Jfq/sGBWRt0CSBur5E1JvtogBgkHvIHm47pKgIgE2G8Xgzyjeq0NtIhEVhx6UT25LFjH0PkI3ylG/7R2dw="}]},"_npmUser":{"name":"nanahira","email":"nanahira@momobako.com"},"directories":{},"maintainers":[{"name":"nanahira","email":"nanahira@momobako.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/sindresorhus__class-names_2.0.0-cjser.2_1778160000003_0.832726082908571"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-07T13:19:59.947Z","2.0.0-cjser.2":"2026-05-07T13:20:00.141Z","modified":"2026-05-07T13:20:00.346Z"},"maintainers":[{"name":"nanahira","email":"nanahira@momobako.com"}],"description":"Conditionally join CSS class names together - Especially useful with React","keywords":["class-names","classnames","class","names","name","classes","react","jsx","component","join","concatenate","concat"],"repository":{"type":"git","url":"https://code.moenext.com/3rdeye/cjser.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"license":"MIT","readme":"# class-names\n\n> Conditionally join CSS class names together - Especially useful with React\n\n## Install\n\n```\n$ npm install @sindresorhus/class-names\n```\n\n## Usage\n\n```js\nimport classNames from '@sindresorhus/class-names';\n\nclassNames('unicorn', 'rainbow');\n//=> 'unicorn rainbow'\n\nclassNames({awesome: true, foo: false}, 'unicorn', {rainbow: false});\n//=> 'awesome unicorn'\n\nclassNames('unicorn', null, undefined, 0, 1, {foo: null});\n//=> 'unicorn'\n\nconst buttonType = 'main';\nclassNames({[`button-${buttonType}`]: true});\n//=> 'button-main'\n```\n\n```jsx\nimport classNames from '@sindresorhus/class-names';\n\nconst Button = props => {\n\tconsole.log(props);\n\t/*\n\t{\n\t\ttype: 'success',\n\t\tsmall: true\n\t}\n\t*/\n\n\tconst buttonClass = classNames(\n\t\t'button',\n\t\t{\n\t\t\t[`button-${props.type}`]: props.type,\n\t\t\t'button-block': props.block,\n\t\t\t'button-small': props.small\n\t\t}\n\t);\n\n\tconsole.log(buttonClass);\n\t//=> 'button button-success button-small'\n\n\treturn <button className={buttonClass}>…</button>;\n};\n```\n\n## API\n\n### classNames(…input)\n\nConditionally join CSS class names together.\n\n#### input\n\nType: `string | object`\n\nAccepts a combination of strings and objects. When an object, only object keys with truthy values are included. Anything else is ignored.\n\n## FAQ\n\n### How is it different from [`classnames`](https://github.com/JedWatson/classnames)?\n\n- Dedupes by default.\n- Does not coerce numbers to strings.\n- Does not support array input. Just use the spread operator.\n\n## Related\n\n- [react-extras](https://github.com/sindresorhus/react-extras) - Useful components and utilities for working with React\n\n## cjser\n\nThis package is a CommonJS-compatible build generated by cjser for projects that still need `require()` support. The source version matches the original npm package version, with a cjser prerelease suffix for this generated build.\nOriginal repository: https://github.com/sindresorhus/class-names\n","readmeFilename":"readme.md","_rev":"1-876206f33a1ea189072c1940cab04f39"}