Skip to content
/ ccom Public

CCOM is minimal interface for writing React components

License

Notifications You must be signed in to change notification settings

moyataka/ccom

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

CCOM is minimal interface for writing React components

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published