UNPKG

@dnb/eufemia

Version:

DNB Eufemia Design System UI Library

55 lines (54 loc) 2.04 kB
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 if set to `true` (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; /** * If set to `true`, the header cell and all `<Td>` cells in the same column receive a highlighted background. Also inherited from the parent `<Tr>` when it has `highlight`. * Default: `false` */ highlight?: boolean; /** * Defines the visual style of the table header. Use `subtle` for a lighter appearance with reduced font-weight, smaller font-size, and muted text color. * Default: `"emphasis"` */ variant?: 'emphasis' | 'subtle'; /** * The content of the component. * Default: `undefined` */ children?: TableThChildren | Array<TableThChildren>; /** * Indicates that the column was previously sorted but returned to unsorted. * Set automatically by `useHandleSortState`. * @internal */ sortedBefore?: boolean; }; 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;