Table
TSX
<Table
headers={['Name', 'Plan', 'Status']}
data={[
['Jane', 'Pro', 'Active'],
['Carlos', 'Team', 'Active'],
['Asha', 'Free', 'Trial'],
]}
/>
| Prop | Type | Default |
|---|---|---|
headers | string[] | — (shorthand) |
data | string[][] | — (shorthand) |
columns | number | 2 (auto-set from headers.length when shorthand is used) |
rows | number | 2 (auto-set from data.length when shorthand is used) |
enableHeader | boolean | true |
The headers + data shorthand is the easiest way to build a static table. For full control, use the values escape hatch:
<Table
values={{
table: {
headers: [{ cells: [{ text: 'Name' }, { text: 'Email' }] }],
rows: [{ cells: [{ text: 'John' }, { text: 'john@example.com' }] }],
},
enableHeader: true,
}}
/>