@viniengelage/materialui-table
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

viniengelage-materialui-button

A table UI Component crafted with react-table and styled-components. This a module for Vinicios Engelage's MaterialUI. Is still under development.

NPM JavaScript Style Guide

Install

npm install --save @viniengelage/materialui-table

or

yarn add @viniengelage/materialui-table

Usage

First

Define columns and data, this is a necessary prop for table.

  const columns = [
    {
      Header: 'Column 1',
      accessor: 'col1'
    },
    {
      Header: 'Column 2',
      accessor: 'col2'
    },
    {
      Header: 'Column 3',
      accessor: 'col3'
    }
  ]

  const data = [
    {
      col1: 'Content',
      col2: 'Content 2',
      col3: 'Conent 3'
    },
    {
      col1: 'Content',
      col2: 'Content 2',
      col3: 'Conent 3'
    },
    {
      col1: 'Content',
      col2: 'Content 2',
      col3: 'Conent 3'
    }
  ]

Second

Now you can define your table

import React from 'react'

import Table from '@viniengelage/materialui-table'

const App = () => {
  const columns = [
    {
      Header: 'Column 1',
      accessor: 'col1'
    },
    {
      Header: 'Column 2',
      accessor: 'col2'
    },
    {
      Header: 'Column 3',
      accessor: 'col3'
    }
  ]

  const data = [
    {
      col1: 'Content',
      col2: 'Content 2',
      col3: 'Conent 3'
    },
    {
      col1: 'Content',
      col2: 'Content 2',
      col3: 'Conent 3'
    },
    {
      col1: 'Content',
      col2: 'Content 2',
      col3: 'Conent 3'
    }
  ]

  return <Table columns={columns} data={data}/>
}

export default App;

License

MIT © viniengelage

Readme

Keywords

none

Package Sidebar

Install

npm i @viniengelage/materialui-table

Weekly Downloads

1

Version

1.0.2

License

MIT

Unpacked Size

51.3 kB

Total Files

11

Last publish

Collaborators

  • viniengelage