clsx
npmv2.1.1TypeScriptA tiny (239B) utility for constructing className strings conditionally.
Overview
clsx is an npm package that a tiny (239B) utility for constructing className strings conditionally. It is extremely widely used, with about 103.7M downloads per week and 1 known dependents in the graph. The latest version is 2.1.1, released under the MIT license.
Who should use it
Teams working in the npm ecosystem who need a tiny (239B) utility for constructing className strings conditionally and value a battle-tested, widely-adopted solution.
When not to use it
Consider an alternative if you need to or if a more actively-maintained option better fits your npm stack.
Pros
- Large, well-established user base (103.7M weekly downloads).
- Ships TypeScript type definitions.
- Clear open-source license (MIT).
- Lean dependency tree (3 direct dependencies).
Cons
- No significant drawbacks detected from available metadata.
Auto-generated from collected registry metadata. No external claims are inferred.
Relationship graph
Dependencies (left) and dependents (right) of clsx.
Dependencies
Dev (3)
Used by
Popular packages that depend on clsx.
Frequently installed together
An extremely fast JavaScript and CSS bundler and minifier.
Encode/decode sourcemap mappings
Modify strings, generate sourcemaps
Programmatic access to the ARIA specification
Remap sequential sourcemaps through transformations to point at the original source code
Next generation testing framework powered by Vite
Programmatic access to information about the AXObject Model
TypeScript definitions for trusted-types
Determine whether an AST node is a reference
Gets the job done when JSON.stringify can't
Uses export conditions to return environment information in a way that works with major bundlers and runtimes.
Parse in reverse
Version history
| Version | Published | License |
|---|---|---|
| 2.1.1latest | 2 years ago | MIT |
| 2.1.0 | 2 years ago | MIT |
| 2.0.1 | 2 years ago | MIT |
| 2.0.0 | 3 years ago | MIT |
| 2.0.0-next.0 | 3 years ago | MIT |
| 1.2.1 | 4 years ago | MIT |
| 1.2.0 | 4 years ago | MIT |
| 1.1.1 | 6 years ago | MIT |
| 1.1.0 | 6 years ago | MIT |
| 1.0.4 | 7 years ago | MIT |
| 1.0.3 | 7 years ago | MIT |
| 1.0.2 | 7 years ago | MIT |
| 1.0.1 | 7 years ago | MIT |
| 1.0.0 | 7 years ago | MIT |
| 0.0.1 | 7 years ago | MIT |
Maintainers
Keywords
Frequently asked questions
How do I install clsx?
Run `npm install clsx` to add clsx to your npm project.
What license is clsx released under?
clsx is distributed under the MIT license.
How popular is clsx?
clsx has approximately 103,711,634 downloads per week and 1 known dependent packages.