Table

Tables are containers for displaying information. They allow users to quickly scan, compare, and take action on large amounts of data.

When including tools, they should be placed directly above or below the table.

Sonnat's Tables are fully customizable. We have implemented the basic features so you can add your own features without any problem / overriding hells.

Basic Table

Basic Table
NameAgeTagsActions
John Doe25
Front-end Developer
Senior
Jim Halpert30
Sales
Manager
Jude Brown23
Back-end Developer
Junior
This is the footer

Dense Table

To have a denser table, use the dense property.

Dense Table
NameAgeTagsActions
John Doe25
Front-end Developer
Senior
Jim Halpert30
Sales
Manager
Jude Brown23
Back-end Developer
Junior
This is the footer

With Selection

Table With Selection
Name
AgeTags
John Doe
25
Front-end Developer
Senior
Jim Halpert
30
Sales
Manager
Jude Brown
23
Back-end Developer
Junior

With Sort

Table With Sort
Name
Age
Tags
Jim Halpert30
Sales
Manager
John Doe25
Front-end Developer
Senior
Jude Brown23
Back-end Developer
Junior

API

Learn more about the properties and the customization points.

Usage

import Table, {
TableHeader,
TableBody,
TableFooter,
TableRow,
TableCell
} from "@sonnat/ui/Table";
//or
import {
Table,
TableHeader,
TableBody,
TableFooter,
TableRow,
TableCell
} from "@sonnat/ui";

Properties

Note that the documentation avoids mentioning all the native props (there are a lot) in this section of the components.

Table Properties

Table Properties
NameTypeDefaultDescription
childrennode-The content of the component.
classNamestring-Append to the class names applied to the component so you can override or extend the styles.
captionstring-Set the content of the <caption> element.
htmlTablePropsobject-The properties applied to the <table> element.
densebooleanfalseIf true, the table will appear denser.
borderLessbooleanfalseIf true, the table will be border-less.
  • The ref is forwarded to the root element.
  • Any other properties supplied will be provided to the root element.

TableHeader Properties

TableHeader Properties
NameTypeDefaultDescription
childrennode-The content of the component.
classNamestring-Append to the class names applied to the component so you can override or extend the styles.
  • The ref is forwarded to the root element.
  • Any other properties supplied will be provided to the root element.

TableBody Properties

TableBody Properties
NameTypeDefaultDescription
childrennode-The content of the component.
classNamestring-Append to the class names applied to the component so you can override or extend the styles.
  • The ref is forwarded to the root element.
  • Any other properties supplied will be provided to the root element.

TableFooter Properties

TableFooter Properties
NameTypeDefaultDescription
childrennode-The content of the component.
classNamestring-Append to the class names applied to the component so you can override or extend the styles.
  • The ref is forwarded to the root element.
  • Any other properties supplied will be provided to the root element.

TableRow Properties

TableRow Properties
NameTypeDefaultDescription
childrennode-The content of the component.
classNamestring-Append to the class names applied to the component so you can override or extend the styles.
verticalAlign"top"
| "middle"
| "bottom"
"middle"Set the vertical-align css property of the table row.
selectedbooleanfalseIf true, the table row will indicate the selected state.
hoverablebooleanfalseIf true, the table row will indicate the hovered state on :hover.
  • The ref is forwarded to the root element.
  • Any other properties supplied will be provided to the root element.

TableCell Properties

TableCell Properties
NameTypeDefaultDescription
childrennode-The content of the component.
classNamestring-Append to the class names applied to the component so you can override or extend the styles.
textAlign"inherit"
| "center"
| "justify"
| "left"
| "right"
"inherit"Set the text-align css property of the table cell.
  • The ref is forwarded to the root element.
  • Any other properties supplied will be provided to the root element.