1.0.2 • Published 3 years ago

zoi-node-modules v1.0.2

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

zoi-node-modules

Made with create-react-library

NPM JavaScript Style Guide

Install

npm install --save zoi-node-modules

TextField

import React, { Component } from 'react'

import { ZTextField } from 'zoi-node-modules'

class TextField extends Component {
  constructor(props) {
    super(props)
    this.state = {
        name:""
    }
  }
  render() {
    return (
      <div>
        <ZTextField
          label="name"
          value={name}
          onChange={(e)=>this.setState({name:e.target.value})}
          isLoading={false}
          variant="filled"
          size="small"
        />
      </div>
    )
  }
}

Property

Prop NameTypeDefaultDescription
valueStringValue represented by this Input if it is controlled.
isLoadingboolIf true, Skeleton component load.
defaultValueStringDefault value represented by this Input if it is uncontrolled.
disabledboolfalseIf true, the component is disabled.
errorboolfalseIf true, the label is displayed in an error state.
helperTextStringIf true, The error text content.
InputPropsobjectProps applied to the Input element. It will be a FilledInput, OutlinedInput or Input component depending on the variant prop value.
variant'filled''outlined''standard'outlinedIf true, The variant to use.

Button

import React, { Component } from 'react'

import { ZButton } from 'zoi-node-modules'

class Button extends Component {
  constructor(props) {
    super(props)
  
  }
  render() {
    return (
      <div>
        <ZButton color="primary" name="Save"></ZButton>
        <ZButton variant="contained" color="success" name="Success" isLoading="true" disabled="true">
        </ZButton>
        <ZButton variant="outlined"color="Secondary" name="Error">
        </ZButton>
      </div>
    )
  }
}

Property

Prop NameTypeDefaultDescription
nameStringDisplay the button name.
isLoadingboolfalseIf true, circular progress load.
disabledboolfalseIf true, the component is disabled.
endIconnodeElement placed after the children.
startIconnodeElement placed before the children.
color'inherit' 'primary' 'secondary' 'success' 'error' 'info' 'warning' stringprimaryElement placed before the children.
variant'contained' 'outlined''text' stringtextThe variant to use..

Typography

import React, { Component } from 'react'

import { ZTypography } from 'zoi-node-modules'

class Typography extends Component {
  constructor(props) {
    super(props)
  
  }
  render() {
    return (
      <div>
       <ZTypography isLoading={true}>Hello</ZTypography>
        <ZTypography variant="h1" component="h2">h1. Heading</ZTypography>  
      </div>
    )
  }
}

Property

Prop NameTypeDefaultDescription
align'center' 'inherit' 'justify' 'left' 'right'inheritSet the text-align on the component..
isLoadingboolfalseIf true, circular progress load.
noWrapboolfalseIf true, the text will not wrap, but instead will truncate with a text overflow ellipsis.

License

MIT © zoi10010