1.0.0 • Published 3 years ago

ccom v1.0.0

Weekly downloads
-
License
MIT
Repository
-
Last release
3 years ago

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; 
  `
)