{"id":14962277,"url":"https://github.com/moishinetzer/classnames-clone","last_synced_at":"2026-01-18T03:18:30.922Z","repository":{"id":57685335,"uuid":"474621633","full_name":"moishinetzer/classnames-clone","owner":"moishinetzer","description":null,"archived":false,"fork":false,"pushed_at":"2022-03-31T11:04:51.000Z","size":1612,"stargazers_count":2,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-11-30T20:51:16.589Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/moishinetzer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-03-27T11:48:10.000Z","updated_at":"2023-03-07T06:20:31.000Z","dependencies_parsed_at":"2022-09-18T23:11:03.919Z","dependency_job_id":null,"html_url":"https://github.com/moishinetzer/classnames-clone","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"purl":"pkg:github/moishinetzer/classnames-clone","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moishinetzer%2Fclassnames-clone","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moishinetzer%2Fclassnames-clone/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moishinetzer%2Fclassnames-clone/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moishinetzer%2Fclassnames-clone/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/moishinetzer","download_url":"https://codeload.github.com/moishinetzer/classnames-clone/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moishinetzer%2Fclassnames-clone/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28528036,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-18T00:39:45.795Z","status":"online","status_checked_at":"2026-01-18T02:00:07.578Z","response_time":98,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-09-24T13:29:49.187Z","updated_at":"2026-01-18T03:18:30.883Z","avatar_url":"https://github.com/moishinetzer.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ClassNames Clone\n\u003e Created for fun, using the latest technologies that make it tiny and pretty fast\n### Not Another Clone 🥱\n\n- Blazing Fast⚡\n- Teensy Small (204B) 🤏\n- Really Easy To Use 👶\n- Completely Type Safe 👷‍♀️\n\n### Installation\nTo install classnames-clone, use:\n\n```bash\nnpm i classnames-clone\n```\n### Well What Does It Do?\nEver wanted to conditionally render your classnames? Well before your code used to look like this:\n```js\n\u003cdiv\n  className={\n    `text-2xl italic ${isActive ? \"bg-gray-400\" : \"\"}`\n  }\n\u003e\n  Hmm not the best\n\u003c/div\u003e\n```\n\nNow it looks like this:\n```js\n\u003cdiv\n  className={\n    classNames('text-2xl italic', {\"bg-gray-400\" : isActive})\n  }\n\u003e\n  Yummy! 🥞\n\u003c/div\u003e\n```\n\n### Usage:\n```js\nimport { classNames } from \"classnames-clone\";\n\n// Joins strings\nclassNames(\"bg-white\", \"text-red-300\") // ==\u003e returns \"bg-white text-red-300\"\n\n// Joins object keys with truthy values\nclassNames(\"bg-white\", {\"text-red-300\": true}) // ==\u003e returns \"bg-white text-red-300\"\n\n// Even flattens out arrays\nclassNames(\"bg-white\", [\"text-red-300\"]) // ==\u003e returns \"bg-white text-red-300\"\n\n// Ignores falsy values\nclassNames(\"bg-white\", {\"text-red-300\": false}) // ==\u003e returns \"bg-white\"\n```\n\n#### Opinions: \nThe official package for classnames allows numbers in it's type definition, however that doesn't make sense when it comes to writing classes so for this package's purpose that has been left out.\n\nPerfect for conditional state class formatting like isActive etc.\n\nThis package was created using [TSDX](https://tsdx.io/) \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoishinetzer%2Fclassnames-clone","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmoishinetzer%2Fclassnames-clone","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoishinetzer%2Fclassnames-clone/lists"}