@eccenca/gui-elements
Version:
GUI elements based on other libraries, usable in React application, written in Typescript.
31 lines (30 loc) • 1.56 kB
TypeScript
import React from "react";
import { DataTableSize as CarbonDataTableSize, Table as CarbonTable } from "@carbon/react";
type TableRowHeightSize = "small" | "medium" | "large";
type CarbonTableProps = React.ComponentProps<typeof CarbonTable>;
export interface TableProps extends Omit<CarbonTableProps, "size" | "overflowMenuOnHover" | "stickyHeader" | "useStaticWidth">, React.TableHTMLAttributes<HTMLTableElement> {
/**
* Sets basically the height of a row inside the table.
*/
size?: TableRowHeightSize;
/**
* All rows are divided by horizontal borders.
*/
hasDivider?: boolean;
/**
* This will lead to a `colgroup` element within the `table` setting `with` styles for each column.
* The table is then displayed `fixed`.
* All values need to be valid CSS width expression, e.g. `30px`, `5rem`, `40%`.
* If you need to add more attributes to the `col` elements, e.g. class names, then you need to control `colgroup` and `fixed` table by yourself.
*/
columnWidths?: string[];
/**
* Table is displayed without any own coloring.
* For example this can be used for sub tables inside other elements with already set background colors.
* Zebra styles won't work if this option is enabled!
*/
colorless?: boolean;
}
export declare const tableRowHeightSizes: Record<string, CarbonDataTableSize>;
export declare function Table({ className, size, hasDivider, columnWidths, colorless, children, ...otherCarbonTableProps }: TableProps): React.JSX.Element;
export default Table;