-
Notifications
You must be signed in to change notification settings - Fork 1
Nicobar
jefferson oliveira edited this page Mar 7, 2018
·
3 revisions
Nicobar
Kind: global class
-
Nicobar
- new Nicobar()
-
.Nicobar() ⇒
React.Component
-
.component(className, style, [element]) ⇒
React.Component
- .set(target, data)
Initiate the library
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>
}
}
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>
}
}
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' });