@app-studio/components
Table
Renders a tabular display for presenting structured data with customizable styles.
View component sourceImport
ts
import { Table } from '@app-studio/components';New to the library? Complete installation and provider setup first.
Interactive examples
Try the component, then open Code to copy the complete example.
import React from 'react';
import { Table } from '@app-studio/components';
export const CaptionDemo = () => {
const cols = [
{ title: 'Invoice', field: 'invoice' },
{ title: 'Payment Status', field: 'paymentStatus' },
{ title: 'Total Amount', field: 'totalAmount' },
{ title: 'Payment Method', field: 'paymentMethod' },
];
const invoices = [
{
invoice: 'INV001',
paymentStatus: 'Paid',
totalAmount: '$250.00',
paymentMethod: 'Credit Card',
},
{
invoice: 'INV002',
paymentStatus: 'Pending',
totalAmount: '$150.00',
paymentMethod: 'PayPal',
},
{
invoice: 'INV003',
paymentStatus: 'Unpaid',
totalAmount: '$350.00',
paymentMethod: 'Bank Transfer',
},
{
invoice: 'INV004',
paymentStatus: 'Paid',
totalAmount: '$450.00',
paymentMethod: 'Credit Card',
},
{
invoice: 'INV005',
paymentStatus: 'Paid',
totalAmount: '$550.00',
paymentMethod: 'PayPal',
},
{
invoice: 'INV006',
paymentStatus: 'Pending',
totalAmount: '$200.00',
paymentMethod: 'Bank Transfer',
},
{
invoice: 'INV007',
paymentStatus: 'Unpaid',
totalAmount: '$300.00',
paymentMethod: 'Credit Card',
},
];
return (
<Table.Template
caption="A list of your recent invoices."
columns={cols}
data={invoices}
/>
);
};Props
Required props are marked below. A dash indicates an unspecified default. Design system configuration can override implementation defaults.
Scroll horizontally to see every column.
| Prop | Type | Default | Description |
|---|---|---|---|
Head | React.FC<any> | — | See the type and source declaration for this property.Source |
Body | React.FC<any> | — | See the type and source declaration for this property.Source |
Row | React.FC<any> | — | See the type and source declaration for this property.Source |
Cell | React.FC<any> | — | See the type and source declaration for this property.Source |
Footer | React.FC<any> | — | See the type and source declaration for this property.Source |
Caption | React.FC<any> | — | See the type and source declaration for this property.Source |
TableContainer | React.FC<any> | — | See the type and source declaration for this property.Source |
children | View typestring | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | React.ReactPortal | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | null | — | Content rendered inside the component.Source |
views | TableViewStyles | — | Style overrides for the named internal parts.Source |
onClick | ((event: React.MouseEvent<HTMLElement>) => void) | — | Called when the user activates the component.Source |
Table.Cell
Scroll horizontally to see every column.
| Prop | Type | Default | Description |
|---|---|---|---|
isFirstColumn | boolean | — | See the type and source declaration for this property.Source |
Table.Template
Scroll horizontally to see every column.
| Prop | Type | Default | Description |
|---|---|---|---|
data Required | any[] | — | Data to render.Source |
columns Required | Column[] | — | Column definitions used to render the data.Source |
footer | FooterCell[] | — | See the type and source declaration for this property.Source |
caption | View typestring | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | React.ReactPortal | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | null | — | See the type and source declaration for this property.Source |
views | TableViewStyles | — | Style overrides for the named internal parts.Source |
For shared layout, color, and responsive properties, read Styling & composition and Responsive layouts. Additional native element attributes depend on the target platform.
Usage guidance
- Give controls a visible label or an accessible name, and verify keyboard interaction. See Accessibility.
- For controlled inputs, update the value from the callback shown in the props table. Keep application state in your component or form library.
- These previews run in the browser. Check React Native setup for platform requirements and differences.