Table
A table displays structured data in rows and columns. Use it for small, static data sets. When users need to sort, search, filter or select, use DataTable instead.
Base
Mantine + override
Mantine
Import
{ Table } from '@mantine/core'
Source
src/themes/theme.ts
src/themes/style-overrides/table.module.css
Usage
| Navn | Rolle | Status |
|---|---|---|
| Ola Nordmann | Prosjektleder | Aktiv |
| Kari Nilsen | Ingeniør | Valgt |
| Per Hansen | Kontrollør | Venter |
| Mona Berg | Arkitekt | Aktiv |
| Jonas Eide | Ingeniør | Aktiv |
| Silje Aas | Kontrollør | Ferdig |
striped
withTableBorder
withRowBorders
withColumnBorders
data-active
Sub-text
size
sm
md
lg
React
<Table>
<Table.Thead>
<Table.Tr>
<Table.Th>Navn</Table.Th>
<Table.Th>Rolle</Table.Th>
<Table.Th>Status</Table.Th>
</Table.Tr>
</Table.Thead>
<Table.Tbody>
<Table.Tr>
<Table.Td>Ola Nordmann</Table.Td>
<Table.Td>Prosjektleder</Table.Td>
<Table.Td>Aktiv</Table.Td>
</Table.Tr>
{/* data-active marks the selected row — ours, not Mantine's */}
<Table.Tr data-active>
<Table.Td>Kari Nilsen</Table.Td>
<Table.Td>Ingeniør</Table.Td>
<Table.Td>Valgt</Table.Td>
</Table.Tr>
<Table.Tr>
<Table.Td>Per Hansen</Table.Td>
<Table.Td>Kontrollør</Table.Td>
<Table.Td>Venter</Table.Td>
</Table.Tr>
<Table.Tr>
<Table.Td>Mona Berg</Table.Td>
<Table.Td>Arkitekt</Table.Td>
<Table.Td>Aktiv</Table.Td>
</Table.Tr>
<Table.Tr>
<Table.Td>Jonas Eide</Table.Td>
<Table.Td>Ingeniør</Table.Td>
<Table.Td>Aktiv</Table.Td>
</Table.Tr>
<Table.Tr>
<Table.Td>Silje Aas</Table.Td>
<Table.Td>Kontrollør</Table.Td>
<Table.Td>Ferdig</Table.Td>
</Table.Tr>
</Table.Tbody>
</Table>
Props
Only what this design system changes or adds. Everything else is Mantine's — read the full props table there.
| Property | Type | Allowed values | Default | Description |
|---|---|---|---|---|
withTableBorder | boolean | — | true | Draws a border around the table. |
horizontalSpacing / verticalSpacing | MantineSpacing | — | xs | Cell padding. |
data-size | string | sm · md · lg | sm | Sets the minimum row height. |
data-active | — | — | — | Set on Table.Tr to mark a selected row. |
Accessibility
- Build the table from
Table.Thead,Table.Tbody,Table.Tr,Table.ThandTable.Td, not a hand-written table element. - The selected row is only shown visually. Add
aria-selectedwhen the selection must reach screen readers.
See Accessibility for the reasoning.