#Table
import Table from "@poodle/ui/Table";
Table
is a simple table component to display tabular data.
Please use Table
component with other table components set to maximize the theming and efficiency.
#Simple
ID | Name | |
---|---|---|
200 | joe@example.com | Joe Kir |
201 | lary@example.com | Lary Hitu |
202 | muni@example.com | Munica Roll |
#Border
We can set table outer border with prop withBorder={true}
.
ID | Name | |
---|---|---|
200 | joe@example.com | Joe Kir |
201 | lary@example.com | Lary Hitu |
202 | muni@example.com | Munica Roll |
#Row divider and hoverable
We can add row divider with prop withDivider={true}
. Also, we can add background
color when the user hover on the row with props withHover={true}
.
ID | Name | |
---|---|---|
200 | joe@example.com | Joe Kir |
201 | lary@example.com | Lary Hitu |
202 | muni@example.com | Munica Roll |
#Row selected
We can add mark a row is selected by add props isSelected={true}
to <TableRow />
component.
The component with propisSelected={true}
will add attribute data-selected="true"
to tr
element.
ID | Name | |
---|---|---|
200 | joe@example.com | Joe Kir |
201 | lary@example.com | Lary Hitu |
202 | muni@example.com | Munica Roll |
#Sizes
Change table size via prop sizeStyle
.
Default table sizes are s
, m
, l
. If you do not set size, the button will use the size m
as default.
ID | Name | |
---|---|---|
200 | joe@example.com | Joe Kir |
201 | lary@example.com | Lary Hitu |
202 | muni@example.com | Munica Roll |
#Theming
Please check theming component document here.
export type TableStyleKeys = "root" | "table"export interface TableThemeConfigextends StandardThemeConfig<TableStyleKeys, TableProps> {}
#Props
#Local Props
Name | Type | Description |
---|---|---|
children | React.ReactNode | |
sizeStyle | "s" \| "m" \| "l" \| string | Change table size. Built-in options are "s" | "m" | "l". Default is "m". |
tableProps | BoxProps | Customize inner table props. |
withBorder | boolean | Apply root border. |
withDivider | boolean | Add divider for each row. |
withHover | boolean | Apply hover style on table row. |
#Full Props
export interface TablePropsextends BoxProps<"table">,StandardComponentProps,LocalTableProps {}