https://github.com/itchakhun/shopify-admin-table
Shopify Admin Table for Polaris styled base
https://github.com/itchakhun/shopify-admin-table
polaris react shopify table-component
Last synced: 8 months ago
JSON representation
Shopify Admin Table for Polaris styled base
- Host: GitHub
- URL: https://github.com/itchakhun/shopify-admin-table
- Owner: itchakhun
- License: mit
- Created: 2018-03-31T04:45:39.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2018-04-01T06:07:01.000Z (almost 8 years ago)
- Last Synced: 2025-04-26T09:08:08.126Z (10 months ago)
- Topics: polaris, react, shopify, table-component
- Language: JavaScript
- Size: 65.4 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# shopify-admin-table
Shopify Admin Table for Polaris styled base
## Props
* **headers** : [] - { title: String, access: String }
* **sources** : [] - Key of each source must be match to **access** header above given data for renderColumn
* **renderColumn**: (data) => React Element
* **onRowClick**: Optional row click callback
## Example
```javascript
import React from 'react';
import Table from '../src';
const data = {
'header-1': 'Cell 1',
'header-2': 'Cell 2',
'header-3': 'Cell 3',
'header-4': 'Cell 4',
'header-5': 'Cell 5'
};
const headers = [...Array(5)].map((_, i) => ({
access: `header-${i + 1}`,
title: `Header ${i + 1}`
}));
const sources = [...Array(10)].map((_, id) => ({ ...data, id: `row-${id}` }));
const App = () => (
cell} />
);
```