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
Name | Age | Tags | Actions |
---|---|---|---|
John Doe | 25 | Front-end Developer Senior | |
Jim Halpert | 30 | Sales Manager | |
Jude Brown | 23 | Back-end Developer Junior | |
This is the footer |
Dense Table
To have a denser table, use the dense
property.
Name | Age | Tags | Actions |
---|---|---|---|
John Doe | 25 | Front-end Developer Senior | |
Jim Halpert | 30 | Sales Manager | |
Jude Brown | 23 | Back-end Developer Junior | |
This is the footer |
With Selection
Age | Tags | |
---|---|---|
25 | Front-end Developer Senior | |
30 | Sales Manager | |
23 | Back-end Developer Junior |
With Sort
Name | Age | Tags |
---|---|---|
Jim Halpert | 30 | Sales Manager |
John Doe | 25 | Front-end Developer Senior |
Jude Brown | 23 | 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";//orimport {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
Name | Type | Default | Description |
---|---|---|---|
children | node | - | The content of the component. |
className | string | - | Append to the class names applied to the component so you can override or extend the styles. |
caption | string | - | Set the content of the <caption> element. |
htmlTableProps | object | - | The properties applied to the <table> element. |
dense | boolean | false | If true , the table will appear denser. |
borderLess | boolean | false | If true , the table will be border-less. |
|
TableHeader Properties
Name | Type | Default | Description |
---|---|---|---|
children | node | - | The content of the component. |
className | string | - | Append to the class names applied to the component so you can override or extend the styles. |
|
TableBody Properties
Name | Type | Default | Description |
---|---|---|---|
children | node | - | The content of the component. |
className | string | - | Append to the class names applied to the component so you can override or extend the styles. |
|
TableFooter Properties
Name | Type | Default | Description |
---|---|---|---|
children | node | - | The content of the component. |
className | string | - | Append to the class names applied to the component so you can override or extend the styles. |
|
TableRow Properties
Name | Type | Default | Description |
---|---|---|---|
children | node | - | The content of the component. |
className | string | - | 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. |
selected | boolean | false | If true , the table row will indicate the selected state. |
hoverable | boolean | false | If true , the table row will indicate the hovered state on :hover . |
|
TableCell Properties
Name | Type | Default | Description |
---|---|---|---|
children | node | - | The content of the component. |
className | string | - | 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. |
|