@macklinu/cx
TypeScript icon, indicating that this package has built-in type declarations

1.0.4 • Public • Published

cx

A utility for creating className strings

Installation

yarn add @macklinu/cx

Usage

This is a simplified version of classnames, where any truthy string argument to the cx() function will be turned into a class string.

import cx from '@macklinu/cx'

cx('foo', 'bar') // 'foo bar'

// say state === 'loading'
cx('bg-red', 'text-white', state === 'loading' && 'is-loading') // 'bg-red text-white is-loading'

cx() // ''

Readme

Keywords

none

Package Sidebar

Install

npm i @macklinu/cx

Weekly Downloads

0

Version

1.0.4

License

MIT

Unpacked Size

5.04 kB

Total Files

12

Last publish

Collaborators

  • macklinu