# lukeed/clsx

A tiny (239B) utility for constructing `className` strings conditionally.

Repository: https://github.com/lukeed/clsx
Canonical: https://ross.abutalabs.com/products/clsx
Language: JavaScript
License: MIT
License Family: permissive
Last push: 2024-06-10T15:48:22+00:00

## Health v2 (maintenance only)
Score: 23/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 0, release rhythm 8, longevity 100
- inputs: {"age_days": 2809, "days_push": 814, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 9832, forks 184 (observed 2026-08-28T04:10:37.416072+00:00)

## What it is
A tiny (239B) JavaScript utility for conditionally constructing CSS className strings from strings, objects, and arrays. It serves as a faster and smaller drop-in replacement for the classnames module.

## Use cases
- conditionally combine css class names in react
- build className strings from objects and arrays
- replace classnames with a smaller faster alternative
- toggle tailwind classes conditionally
- join css classes while filtering falsey values

## When to choose
- you need a minimal, dependency-free classname builder for any frontend framework
- you want a drop-in classnames replacement with better performance and size
- you only need string concatenation and can use the 140-byte lite build

## When to avoid
- you need CSS-in-JS or style object handling rather than class name strings
- you rely on classnames plugins or features clsx does not implement

## Facets
- artifact type: library
- maturity: stable
- function: ui-components, frontend-framework
- domain: frontend, web-development
- platform: browser, cross-platform
- tags: classnames, css-classes, conditional-classes, tiny-utility, drop-in-replacement, tailwind, nodejs

## Member repositories
- lukeed/clsx (main) score 23

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:10:37.416072+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:20:55.678537+00:00, confidence not recorded.
  - readme: https://github.com/lukeed/clsx (fetched 2026-08-28T04:10:37.416072+00:00, sha e375b5696209)
  - registry_npm: https://registry.npmjs.org/clsx (fetched 2026-08-29T08:20:42.137753+00:00, sha 64c689085805)
- Data as of 2026-08-30T08:39:29.467469+00:00.
