1.0.0 • Published 3 years ago

dugoly-nc-library v1.0.0

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

dugoly-nc-library

dugoly, no connection library. The uniqueness of this library compared to other dugoly libraries is that its components do not need a network or database connection. The library contains simple components

Install

npm install --save dugoly-nc-library

Usage

import React from 'react'
import { ComponentMultiplier } from 'dugoly-nc-library'

const App = () => {
  
  const component=({text})=>(<div>
  <h1>this is my component</h1>
  <h6>this is my text: {text}</h6>
</div>)
  
  return <ComponentMultiplier 
  ComponentToMultiply={component} 
  ComponentProps={{text:"this is working"}} 
  AbsoluteNumber={3} 
  index={false} 
  generalContainerStyle={{maxWidth:"300px"}}  
  componentContainerStyle={{backgroundColor:"red"}}  />
}

export default App

The components that can be imported from this library

  • ComponentMultiplier -Multiplies components, accepts the component and multiplies it or allows the user to multiplies it, The default is to display it only once and allow the user to duplicate it. For more details on dugoly-nc-library

ComponentMultiplier props

  • ComponentToMultiply - Gets the function that returns the required component for multiplication.
  • ComponentProps - Gets an object that contains the props required for a multiplied component.
  • AbsoluteNumber - Gets the number of times the component needs to appear, note: Using this value will prevent the end user from doubling the component.
  • index - Accepts true or false, whether to display the component counter, the default is true.
  • generalContainerStyle - gets an object containing the style required for the general container of all components, in order to have no style at all an empty object must be entered at this value, otherwise the default style will be accepted
  • componentContainerStyle - gets an object containing the style required for the container containing the duplicate component, in order to have no style at all an empty object must be entered at this value, otherwise the default style will be accepted

Additional libraries

To view dugoly's list of libraries click here

License

MIT © omershiran motto - Application and website development