@ctx-core/html
TypeScript icon, indicating that this package has built-in type declarations

11.8.55 • Public • Published

@ctx-core/html

Utility html functions.

class_

class_ has the same functionality as clsx yet is 94 B, or < 50% the size of clsx. It's also a good way to break up tailwind class usage...which is useful for reordering classes into logical groups.

This example uses relementjs, but any UI library can be used.

import { class_ } from '@ctx-core/html'
import { div_ } from 'relementjs/html'
div_({
  class: class_(
    ['foo', ['bar'], 0 && ['will-not-render']],
		{ 'font-bold': is_bold },
    'text-white',
		'bg-black')
}, 'Hello!')

This library is implemented in ctx-core which has 0 dependencies & has a wide breadth of modules. Importing class_ in the above example would look like:

import { class_ } from 'ctx-core/html'

More docs to come.

Readme

Keywords

Package Sidebar

Install

npm i @ctx-core/html

Weekly Downloads

207

Version

11.8.55

License

Apache-2.0

Unpacked Size

3.13 kB

Total Files

6

Last publish

Collaborators

  • btakita