Skip to content

Nicobar

jefferson oliveira edited this page Mar 7, 2018 · 3 revisions

Nicobar

Nicobar

Kind: global class

new Nicobar()

Initiate the library

nicobar.Nicobar() ⇒ React.Component

Returns the React Wrap component to be used on your component

Kind: instance method of Nicobar
Returns: React.Component - Wrapper component
Example
//usage

import { Nicobar } from 'nicobar'

class MyComponent extends React.Component {
 render() {
   return <Nicobar style={obj}>
     ...
   </Nicobar>
 }
}

nicobar.component(className, style, [element]) ⇒ React.Component

Single Component implementation for Nicobar

Kind: instance method of Nicobar
Returns: React.Component - Returns the element wrapped by Nicobar

Param Type Description
className String Class name used in CSS to handle the custom properties
style Object Object with name of custom properties that you want change.
[element] React.Component | Strung Element that will be rendered in this context.

Example
//usage with dom element

import { component } from 'nicobar'

const MyNicobarComponent = component.div('className', { myStyle });

class MyComponent extends React.Component {
 render() {
   return <div>
     ...
      <MyNicobarComponent />
     ...
   </div>
 }
}

Example
//usage with Custom Component

import { component } from 'nicobar'
import OtherComponent from 'any_file'

const MyNicobarComponent = component('className', { myStyle }, OtherComponent);

class MyComponent extends React.Component {
 render() {
   return <div>
     ...
      <MyNicobarComponent />
     ...
   </div>
 }
}

nicobar.set(target, data)

Set the data to the Header and updates the Custom Properties into CSS

Kind: instance method of Nicobar

Param Type Description
target HTMLElement | String Customization Target
data Object Custom Properties values

Example
//Usage

 nicobar.set('.some-class', { background: '#0f0' });