Packages

clsx

2.1.1 · 23 Apr 2024MIT164.3M / weekRepositoryHomepagenpmAtom feed

Your version

Where each line stands

Plan an upgrade
  • 2.x2.1.1No known advisoryLatest line
  • 1.x1.2.1No known advisoryTo 2.1.1
  • 0.x0.0.1No known advisoryTo 2.1.1

Latest releases

  1. 2.x · latest line
  2. 2.1.1

    23 Apr 2024
  3. 2.1.0

    29 Dec 2023
    • Add new clsx/lite submodule for string-only usage: 1a49142

      This is a 140b version of clsx that is ideal for Tailwind and/or React contexts, which typically follow this clsx usage pattern:

      clsx('foo bar', props.maybe && 'conditional classes', props.className);

      Important: This clsx/lite module ignores all non-string arguments and is therefore not a 1:1 replacement for clsx itself!

      import { clsx } from 'clsx';
      import { clsx as lite } from 'clsx/lite';
      
      // strings-only usage is identical
      clsx('foo', null, 'bar', true && 'baz'); //=> "foo bar baz"
      lite('foo', null, 'bar', true && 'baz'); //=> "foo bar baz"
      
      // clsx/lite ignores all non-strings
      clsx('foo', { a: true, b: false, c: true }); //=> "foo a c"
      lite('foo', { a: true, b: false, c: true }); //=> "foo"
  4. 2.0.1

    29 Dec 2023
    • (perf) Cache arguments.length & array.length for 6% performance gain (#26): deff09b
      Adds 5 bytes (+2%) for ~3% avg performance gain
      Thank you @jalalazimi

Dependency tracking · free for 3 projects

Know when your own dependencies move

This page watches clsx. inlinr reads your package.json and keeps the same watch on every dependency you declare, then tells you only what needs you.

  • Advisories reach you

    An email when a critical or high advisory affects a project, before the next install.

  • Upgrades checked first

    Peer ranges, Node, ESM-only and types changes read before you bump.

  • Only what matters

    Majors and breaking notes stay; patches and sibling bumps fold into one line.

How dependency tracking works

Registry facts last checked 9 Nov 2026. Releases and advisories last read 10 Nov 2026.