@classed/react
TypeScript icon, indicating that this package has built-in type declarations

0.2.0 • Public • Published

classed

license version size downloads

@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>;

Authors

github

License

MIT License

Package Sidebar

Install

npm i @classed/react

Weekly Downloads

83

Version

0.2.0

License

MIT

Unpacked Size

40.9 kB

Total Files

7

Last publish

Collaborators

  • flamrdevs