Skip to content

Latest commit

 

History

History
174 lines (150 loc) · 3.53 KB

README.md

File metadata and controls

174 lines (150 loc) · 3.53 KB

Pro React Components

Introduction

This project includes custom components built using ReactJs. It includes the following components:

  • Custom Button
  • Custom Modal
  • Custom Table
  • Custom Input
  • Custom Stepper
  • Custom Loaders
  • Error Page

Installation

To install this project, run the following command:

npm install pro-react-components

Usage

To use this project, import the components you want to use in your project as follows:

import {
  MyButton,
  LButton,
  Table,
  CircularLoader,
  BarLoader,
  CustomModal,
  CustomStepper,
  ErrorPage,
} from 'pro-react-components'

Example

import React from 'react'
import {
  MyButton,
  LButton,
  Table,
  CircularLoader,
  BarLoader,
  CustomModal,
  CustomStepper,
  ErrorPage,
} from 'pro-react-components'

const App = () => {
  return (
    <div>
      <MyButton 
        variant="contained"
        color="primary"
        onClick={() => console.log('Button clicked')}
      />
      <LButton 
        variant="contained"
        color="primary"
        onClick={() => console.log('Button clicked')}
      />
      <Table
        columns={[
          {
            name: 'Name',
            selector: 'name',
          },
          {
            name: 'Email',
            selector: 'email',
          },
          {
            name: 'Age',
            selector: 'age',
          },
        ]}
        data={[
          {
            name: 'John',
            email: '[email protected]',
            age: 25,
          },
          {
            name: 'Jane',
            email: '[email protected]',
            age: 22,
          },
          {
            name: 'Jack',
            email: '[email protected]',
            age: 27,
          },
          {
            name: 'Janice',
            email: '[email protected]',
            age: 30,
          },
          {
            name: 'Judy',
            email: '[email protected]',
            age: 28,
          },
          {
            name: 'Jill',
            email: '[email protected]',
            age: 35,
          },
          {
            name: 'Joe',
            email: '[email protected]',
            age: 32,
          },
        ]}
        showSearch={true}
        title={'Users'}
        buttons={[
          {
            children: 'Add',
            variant: 'contained',
            color: 'primary',
            onClick: () => console.log('Add clicked'),
          },
          {
            children: 'Delete',
            variant: 'contained',
            color: 'error',
            onClick: () => console.log('Delete clicked'),
          },
        ]}
        onRowClicked={(row) => console.log(row)}
      />
      <CircularLoader />
      <BarLoader />
      <CustomModal />
      <CustomStepper />
      <ErrorPage />
    </div>
  )
}

export default App

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change. If you would like to contribute to this project, please fork this repository and make changes as you'd like. Pull requests are warmly welcome.

Please make sure to update tests as appropriate.

Author

Kibet Immanuel Ng'eno

Versioning

This is the first version of this project.

License

This project is licensed under the MIT License.MIT

Acknowledgments