@ashiknesin/react-tiny-table
v0.0.1
Published
Simple table library for React
Downloads
5
Readme
react-tiny-table
Simple table library for React
Install
npm install --save react-tiny-table
Usage
import React, { Component } from 'react'
import TinyTable from '@ashiknesin/react-tiny-table'
const columns = [
{
title: 'Subscription Info',
dataIndex: 'subscriptionInfo',
key: 'subscriptionInfo',
fixed: 'left' // To make it fixed (left)
},
{
title: 'Customer Info',
dataIndex: 'customerInfo',
key: 'customerInfo'
},
{
title: 'MRR',
dataIndex: 'mrr',
key: 'mrr'
},
{
title: 'Created On',
dataIndex: 'createdOn',
key: 'createdOn',
fixed: 'right'
// To make it fixed (right)
},
{
title: 'Custom Field Right',
dataIndex: 'customField',
key: 'customField'
}
];
const dataset = [
{
subscriptionInfo: 'Ashik Nesin',
customerInfo: 'cloud---entry',
customerEmail: '[email protected]',
customerWebsite: 'https://nesin.io',
nextRenewal: '17 Feb 2020',
mrr: '$50.00 USD',
createdOn: '22 Jan 2020',
customField: 'Demo'
}
];
const data = Array.from({ length: 50 }).map(x => dataset[0]);
class TinyTableDemo extends Component {
render () {
return (
<TinyTable columns={columns} dataSource={data} />
)
}
}
License
MIT © AshikNesin