New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

acvx

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

acvx

Tiny library to deal with class names

latest
Source
npmnpm
Version
1.3.0
Version published
Maintainers
1
Created
Source

acvx - Atomic Class Variant eXpressions

Tiny library to deal with class names. You can use it with Tailwind CSS to create components like ShadCN does.

It's a combination of clsx and cva with all features from both but reduced bundle size and improved performance.

Works on browser, commonjs and ES6. Zero dependencies.

Documentation: Full Usage Guide

import {ax, av} from "acvx";

const redColor = true;

const buttonVariants = av("bg-blue-500", {
  "variants": {
    "bg": {
      "blue": "bg-blue-500",
      "red": "bg-red-300"
    }
  },
  "defaultVariants": {
    "bg": "blue"
  }
});

// For h1, "text-2xl text-red-500" as redColor is true
// For button, bg depends on the variant used

const App = ({bg}) => {
  return <>
    <h1 className={ax("text-2xl", {
      "text-red-500": redColor
    })}>Hello</h1>

    <button className={buttonVariants({bg})}>world</button>
  </>
}

export default App

Socials + Donate

Keywords

acvx

FAQs

Package last updated on 26 Mar 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts