UNPKG

1.63 kBTypeScriptView Raw
1import * as React from 'react';
2import { SxProps } from '@mui/system';
3import { Theme } from '..';
4import { OverridableComponent, OverrideProps } from '../OverridableComponent';
5import { TableRowClasses } from './tableRowClasses';
6
7export interface TableRowOwnProps {
8 /**
9 * Should be valid `<tr>` children such as `TableCell`.
10 */
11 children?: React.ReactNode;
12 /**
13 * Override or extend the styles applied to the component.
14 */
15 classes?: Partial<TableRowClasses>;
16 /**
17 * If `true`, the table row will shade on hover.
18 * @default false
19 */
20 hover?: boolean;
21 /**
22 * If `true`, the table row will have the selected shading.
23 * @default false
24 */
25 selected?: boolean;
26 /**
27 * The system prop that allows defining system overrides as well as additional CSS styles.
28 */
29 sx?: SxProps<Theme>;
30}
31
32export interface TableRowTypeMap<
33 AdditionalProps = {},
34 RootComponent extends React.ElementType = 'tr',
35> {
36 props: AdditionalProps & TableRowOwnProps;
37 defaultComponent: RootComponent;
38}
39/**
40 * Will automatically set dynamic row height
41 * based on the material table element parent (head, body, etc).
42 *
43 * Demos:
44 *
45 * - [Table](https://mui.com/material-ui/react-table/)
46 *
47 * API:
48 *
49 * - [TableRow API](https://mui.com/material-ui/api/table-row/)
50 */
51declare const TableRow: OverridableComponent<TableRowTypeMap>;
52
53export type TableRowProps<
54 RootComponent extends React.ElementType = TableRowTypeMap['defaultComponent'],
55 AdditionalProps = {},
56> = OverrideProps<TableRowTypeMap<AdditionalProps, RootComponent>, RootComponent> & {
57 component?: React.ElementType;
58};
59
60export default TableRow;