@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() // ''

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.4
    5
    • latest

Version History

Package Sidebar

Install

npm i @macklinu/cx

Weekly Downloads

1

Version

1.0.4

License

MIT

Unpacked Size

5.04 kB

Total Files

12

Last publish

Collaborators

  • macklinu