@classed/react
v0.2.0
Published
Classed components for React
Downloads
434
Maintainers
Readme
@classed/react
Introduction
Classed components for React.
Installation
npm install @classed/react
# or
yarn add @classed/react
# or
pnpm add @classed/react
# or
bun add @classed/react
Examples
basic
with classed utils cx
import classed from "@classed/react";
// components
const Button = classed("button", "btn", "btn-primary", "btn-medium");
// render
<Button className={["extra", "class" /* any cx ClassedClassValue */]}>button</Button>;
custom concatenation
with clsx
import { create } from "@classed/react";
import clsx from "clsx";
const classed = create({ cx: clsx });
// components
const Button = classed("button", "btn", "btn-primary", "btn-medium");
// render
<Button className={["extra", "class" /* any clsx ClassValue */]}>button</Button>;