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

0.8.6 • Public • Published

Table

The GDS Table component.

Preview

Preview

Using this package

First install the package into your project:

npm install -S @not-govuk/table

Then use it in your code as follows:

import React, { createElement as h } from 'react';
import Table from '@not-govuk/table';

export const MyComponent = props => (
  <Table
    keys={['date', 'amount']}
    headings={{
      amount: 'Amount',
      date: 'Date'
    }}
    data={[
      {
        amount: '£109.80 per week',
        date: 'First 6 weeks'
      },
      {
        amount: '£109.80 per week',
        date: 'Next 33 weeks'
      },
      {
        amount: '£4,282.20',
        date: 'Total estimated pay'
      },
    ]}
  />
);

export default MyComponent;

Working on this package

Before working on this package you must install its dependencies using the following command:

pnpm install

Testing

npm test

Building

npm run build

Clean-up

npm run clean

Readme

Keywords

Package Sidebar

Install

npm i @not-govuk/table

Weekly Downloads

125

Version

0.8.6

License

MIT

Unpacked Size

5.33 kB

Total Files

7

Last publish

Collaborators

  • daniel-ac-martin