# JedWatson/classnames

A simple javascript utility for conditionally joining classNames together

Repository: https://github.com/JedWatson/classnames
Canonical: https://ross.abutalabs.com/products/classnames
Language: JavaScript
License: MIT
License Family: permissive
Last push: 2026-08-24T02:33:06+00:00

## Health v2 (maintenance only)
Score: 77/100 (v2, computed 2026-09-03T02:39:23.370411+00:00)
- activity 99, release rhythm 35, longevity 100
- inputs: {"age_days": 4320, "days_push": 10, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: no_releases
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 17783, forks 559 (observed 2026-08-28T04:11:20.416715+00:00)

## What it is
A tiny JavaScript utility for conditionally joining CSS class names together. It is a widely used npm package, especially common in React projects.

## Use cases
- conditionally apply css classes in react components
- join class names based on boolean flags
- build dynamic className strings
- toggle css classes without string concatenation
- clean up conditional styling logic in javascript

## When to choose
- you need a tiny, dependency-free utility for composing class names
- you work with React or other component libraries and want idiomatic conditional classes
- you want a battle-tested, stable package with huge adoption

## When to avoid
- you use a framework with built-in class name helpers
- you need CSS-in-JS or runtime styling solutions rather than class name strings

## Facets
- artifact type: library
- maturity: stable
- function: ui-components, developer-tools
- domain: web-development, frontend
- platform: browser, cross-platform
- tags: css-classes, react, utility, conditional-classnames, nodejs

## Member repositories
- JedWatson/classnames (main) score 77

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:11:20.416715+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-29T17:02:27.378811+00:00, confidence not recorded.
  - readme: https://github.com/JedWatson/classnames (fetched 2026-08-28T04:11:20.416715+00:00, sha 197b72ca098e)
  - registry_npm: https://registry.npmjs.org/classnames (fetched 2026-08-29T08:00:54.149329+00:00, sha 3933d76e074b)
- Data as of 2026-08-30T08:39:29.467469+00:00.
