
Security News
Feross on TBPN: How North Korea Hijacked Axios
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.
@govuk-react/table
Advanced tools
A styled table supporting a 'construction kit' approach and rendering children as constituent parts.
import Table from '@govuk-react/table';
The Table component provides a construction kit of elements to create a table
Component default
import { Table } from 'govuk-react'
<Table caption="Dates and amounts">
<Table.Row>
<Table.CellHeader>First 6 weeks</Table.CellHeader>
<Table.Cell>£109.80 per week</Table.Cell>
</Table.Row>
<Table.Row>
<Table.CellHeader>Next 33 weeks</Table.CellHeader>
<Table.Cell>£109.80 per week</Table.Cell>
</Table.Row>
<Table.Row>
<Table.CellHeader>Total estimated pay</Table.CellHeader>
<Table.Cell>£4,282.20</Table.Cell>
</Table.Row>
<Table.Row>
<Table.CellHeader>Tell the mother’s employer</Table.CellHeader>
<Table.Cell>28 days before they want to start maternity pay</Table.Cell>
</Table.Row>
</Table>
Numeric tabular data
const example2Head = (
<Table.Row>
<Table.CellHeader>Month you apply</Table.CellHeader>
<Table.CellHeader numeric>Rate for vehicles</Table.CellHeader>
<Table.CellHeader numeric>Rate for bicycles</Table.CellHeader>
</Table.Row>
);
<Table
caption="Attention, I am the caption of this ship!"
head={example2Head}
>
<Table.Row>
<Table.CellHeader>January</Table.CellHeader>
<Table.Cell numeric>£165.00</Table.Cell>
<Table.Cell numeric>£85.00</Table.Cell>
</Table.Row>
<Table.Row>
<Table.CellHeader>February</Table.CellHeader>
<Table.Cell numeric>£165.00</Table.Cell>
<Table.Cell numeric>£85.00</Table.Cell>
</Table.Row>
<Table.Row>
<Table.CellHeader>March</Table.CellHeader>
<Table.Cell numeric>£151.00</Table.Cell>
<Table.Cell numeric>£77.00</Table.Cell>
</Table.Row>
<Table.Row>
<Table.CellHeader>April</Table.CellHeader>
<Table.Cell numeric>£136.00</Table.Cell>
<Table.Cell numeric>£70.00</Table.Cell>
</Table.Row>
</Table>
Setting custom column widths
<Table
caption="Custom header"
head={
<Table.Row>
<Table.CellHeader setWidth="one-half>Wide header</Table.CellHeader>
<Table.CellHeader setWidth="30%">Regular</Table.CellHeader>
<Table.CellHeader>Normal</Table.CellHeader>
</Table.Row>
}
>
<Table.Row>
<Table.Cell>Header makes this column one-half wide</Table.Cell>
<Table.Cell>And this one 30%</Table.Cell>
<Table.Cell>Another</Table.Cell>
</Table.Row>
</Table>
| Prop | Required | Default | Type | Description |
|---|---|---|---|---|
body | undefined | node | Table body rows and cells (for backward compatibility) | |
caption | undefined | string | Table caption title | |
children | undefined | node | Table body rows and cells (recommended way) | |
head | undefined | node | Table header rows and cells |
FAQs
A styled table supporting a 'construction kit' approach and rendering children as constituent parts.
The npm package @govuk-react/table receives a total of 1,529 weekly downloads. As such, @govuk-react/table popularity was classified as popular.
We found that @govuk-react/table demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 5 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.

Security News
OpenSSF has issued a high-severity advisory warning open source developers of an active Slack-based campaign using impersonation to deliver malware.

Research
/Security News
Malicious packages published to npm, PyPI, Go Modules, crates.io, and Packagist impersonate developer tooling to fetch staged malware, steal credentials and wallets, and enable remote access.