The Table component is used to show all information from a data set.
Evergreen exports a set of building blocks for building tables.
This package is also used in places such as the options list in the SelectMenu
component.
Currently this package does not use real table elements.
table
, th
or tr
.Pane
components combined with Text
.Evergreen exports the following components for tables:
Table
Table.Head
Table.Body
Table.Row
Table.Cell
Table.TextCell
Table.HeaderCell
Table.TextHeaderCell
Table.SearchHeaderCell
The source code of this example is available in docs/src/components/examples/AdvancedTable
on GitHub.
The following table is virtualized with Table.VirtualBody
.
Use onSelect
and isSelectable
on a Table.Row
to make it clickable.
Last ActivityltvCheryl Cartera few seconds ago$365Heather Moralesa minute ago$427Sean Jackson3 minutes ago$538Catherine Anderson4 minutes ago$171Jack Phillips6 minutes ago$222Julia Williamson7 minutes ago$365Jonathan Martin8 minutes ago$392Maria Bennett10 minutes ago$795Sarah Garrett11 minutes ago$844Carl Barnes13 minutes ago$430Aaron Turner14 minutes ago$872Billy Reed15 minutes ago$997Anna Fuller17 minutes ago$275Linda Torres18 minutes ago$359Angela Allen20 minutes ago$270Phyllis Perkins21 minutes ago$314Marilyn Fuller22 minutes ago$116Ryan Alvarez24 minutes ago$192Fred Lane25 minutes ago$520Jane Sims27 minutes ago$702Angela Ellis28 minutes ago$771Diane Dunn29 minutes ago$849Timothy Duncan31 minutes ago$439Ronald Mendoza32 minutes ago$31Michael Gilbert34 minutes ago$862Kathryn Fuller35 minutes ago$897Ralph Larson36 minutes ago$248Karen Wagner38 minutes ago$372Christina Morales39 minutes ago$945Daniel Palmer41 minutes ago$862Joshua Murray42 minutes ago$346Timothy West43 minutes ago$858Martin Bradleyan hour ago$39Philip Hallan hour ago$993Keith Willisan hour ago$83Patricia Harrisan hour ago$465Frances Nguyenan hour ago$616Larry Wardan hour ago$89Benjamin Adamsan hour ago$300Jane Jamesan hour ago$936
Table cells are all using flex layout. The below example shows how to create fixed width cells. Make sure to add the same properties to each cell in each row and head.
This component is the container of all your table components.
It is simply a Pane
and not an actual table element.
This component is used for table rows in your table and can be selectable and selected.
Table rows can have a intent
prop as well.
This component is for table cells in your table.
Consider using Table.TextCell
when you want to display text in your table cell.
This can be used as a base to build more complex table cells.
Virtual tables in Evergreen are easy to create. Evergreen gives some nice features when working with virtual tables:
Table.VirtualBody
is a drop-in replacement for Table.Body
height="auto"
, this will reduce performance howeverscrollOffset
, scrollToIndex
and scrollToAlignment
that are passed down to VirtualList
from react-tiny-virtual-list
.