@dnb/eufemia
Version:
DNB Eufemia Design System UI Library
51 lines (50 loc) • 1.8 kB
TypeScript
import type { ReactNode, ThHTMLAttributes } from 'react';
import TableSortButton from './TableSortButton';
import TableHelpButton from './TableHelpButton';
export type TableThChildren = ReactNode | ReturnType<typeof TableSortButton> | ReturnType<typeof TableHelpButton>;
export type TableThProps = {
/**
* Defines the table header as sortable (ascending)
* Default: `false`
*/
sortable?: boolean;
/**
* Defines the sortable column as the current active (ascending)
* Default: `false`
*/
active?: boolean;
/**
* Defines the sortable column as in reversed order (descending)
* Default: `false`
*/
reversed?: boolean;
/**
* If set to true, the header text will not wrap to new lines
* Default: `false`
*/
noWrap?: boolean;
/**
* Highlights the cell with a subtle background overlay.
* Use together with `useTableHighlight` to highlight the entire column.
* Default: `false`
*/
highlight?: boolean;
/**
* Defines the visual variant of the table header.
* `emphasis` renders with medium font weight.
* `subtle` renders with regular font weight, smaller font size, and lighter color.
* Default: `emphasis`
*/
variant?: 'emphasis' | 'subtle';
/**
* The content of the table header given as Tr.
*/
children?: TableThChildren | Array<TableThChildren>;
};
declare function Th(componentProps: TableThProps & ThHTMLAttributes<HTMLTableCellElement>): import("react/jsx-runtime").JSX.Element;
declare namespace Th {
var SortButton: typeof TableSortButton;
var HelpButton: typeof TableHelpButton;
var Horizontal: ({ className, ...rest }: ThHTMLAttributes<HTMLDivElement>) => import("react/jsx-runtime").JSX.Element;
}
export default Th;