github joe-bell/cva v0.4.0

latest releases: v1.0.0-beta.4, v1.0.0-beta.3, v1.0.0-beta.2...
2 years ago

What's Changed

Features

  • Target Multiple Variant Options within Compound Variants by @joe-bell and @JeroenReumkens in #76

    // components/button.ts
    import { cva } from "class-variance-authority";
    
    const button = cva("…", {
      variants: {
        intent: { primary: "…", secondary: "…" },
        size: { small: "…", medium: "…" },
      },
      compoundVariants: [
        // Applied via:
        //   `button({ intent: "primary", size: "medium" })`
        //     or
        //   `button({ intent: "secondary", size: "medium" })`
        {
          intent: ["primary", "secondary"],
          size: "medium",
          class: "…",
        },
      ],
    });

Chores

New Contributors

Full Changelog: v0.3.0...v0.4.0

Don't miss a new cva release

NewReleases is sending notifications on new releases.