cnfast is a high-performance JavaScript replacement for the common cn utility used in Tailwind CSS projects. It combines conditional class values and resolves conflicting Tailwind classes while preserving byte-identical output with tailwind-merge. The package exposes cn, clsx, twMerge, and twJoin through a familiar API. Existing clsx, classnames, tailwind-merge, and shadcn/ui projects can migrate with minimal or automated changes. Caching and an optimized merge engine improve performance during repeated renders and component-heavy workloads. It supports standard function calls and tagged templates and is distributed as a compact npm package.

Features

  • Tailwind class conflict resolution
  • Conditional class value merging
  • Drop-in cn API compatibility
  • Automated project migration command
  • Function and tagged-template syntax
  • Optimized caching and merge performance

Project Samples

Project Activity

See All Activity >

Categories

Libraries

License

MIT License

Follow cnfast

cnfast Web Site

Other Useful Business Software
Our Free Plans just got better! | Auth0 Icon
Our Free Plans just got better! | Auth0

With up to 25k MAUs and unlimited Okta connections, our Free Plan lets you focus on what you do best—building great apps.

You asked, we delivered! Auth0 is excited to expand our Free and Paid plans to include more options so you can focus on building, deploying, and scaling applications without having to worry about your security. Auth0 now, thank yourself later.
Try free now
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of cnfast!

Additional Project Details

Programming Language

TypeScript

Related Categories

TypeScript Libraries

Registered

3 days ago