The Table component lets you display a table of data. Like the list components, you can pass data (an array of objects) to the table to iterate over.

How to use

Like the list components, you can pass data (an array of objects) to the table to iterate over, but there's no Triggers. It has several Config props to help customize things like padding and border.

Inside the Table, you can nest Table Row components. These have some of their own Config props to further customize padding and border. You can also set a Table Row to be the header for the Table.

And finally inside the Table Row you can nest the Table Cells. These components have most of the same style props as a View in addition to some Config props for the border.

Some prop values are passed down the child tree. For example, when you set the "Border Width" prop on the Table, that will be applied to all Table Rows and Cells. This value can then be overridden at the Row level or the Cell level. The props that have this effect are described as such in the prop descriptions.

Configuration Properties

PropertyDescription
Component nameThe name of the component as it appears in the Screen's component tree
Border widthSpecifies the width of the border. Passed down to child Table(Row/Cell) components unless overridden
Show vertical scroll indicatorWhen true, shows a vertical scroll indicator. The default value is true.
Draw top borderWhether to draw the top border at this layer of the Table tree or not
Draw bottom borderWhether to draw the bottom border at this layer of the Table tree or not
Draw start borderWhether to draw the start border at this layer of the Table tree or not
Cell vertical paddingSpecifies the vertical padding of the cell. Passed down to TableCell components unless overridden
Cell horizontal paddingSpecifies the horizontal padding of the cell. Passed down to TableCell components unless overridden
Draw borderWhether to draw the end border at this layer of the Table tree or not
Border colorSpecifies the color of the border. Passed down to child Table(Row/Cell) components unless overridden
Border styleSpecifies the style of the border. Passed down to child Table(Row/Cell) components unless overridden

Data Properties

PropertyDescription
DataThe data to render in the table as an array of objects