ccom

1.0.0 • Public • Published

CCOM

CCOM is minimal interface for writing React components

INSTALL

npm install ccom

Usage

import ccom from 'ccom'

const Comp = ccom('div')(
  `
    classname1 classname2 ...
  `,
  `
    styles...
  `
)

Example

const EmptyDiv = ccom('div')()

const ClassDiv = ccom('div')(
  `
    bg-primary
  `
)

const StyleImg = ccom('img')(``,
  `
    width: 175px;
    height: 167px;
  `
)


const CondButton = ccom('button')(
  ({disabled}) => `
    bg-white
    border-solid border-2
    ${disabled ? `text-disabled` : `text-primary`}
    ${disabled ? `border-disabled` : `border-primary`}
  `,
  ({w=120}) => `
    width: ${w}px;
    height: 36px; 
  `
)

Readme

Keywords

none

Package Sidebar

Install

npm i ccom

Weekly Downloads

0

Version

1.0.0

License

MIT

Unpacked Size

2.51 kB

Total Files

4

Last publish

Collaborators

  • moyataka