UNPKG

@itwin/itwinui-react

Version:

A react component library for iTwinUI

51 lines (50 loc) 1.74 kB
import * as React from 'react'; import type { CellRendererProps } from '../../../react-table/react-table.js'; export type DefaultCellProps<T extends Record<string, unknown>> = { /** * Custom icon to be displayed at the beginning of the cell. */ startIcon?: React.JSX.Element; /** * Custom icon to be displayed at the end of the cell. */ endIcon?: React.JSX.Element; /** * Status of the cell. */ status?: 'positive' | 'negative' | 'warning'; /** * Should the contents of the cell be clamped after a certain number of lines? * * Will be enabled by default if the `text` prop is used, or if the cell content * is a string and a custom `Cell` is not specified in the column object. */ clamp?: boolean; /** * Main text content displayed inside the cell. This takes precedence over `children`. * * This will be conditionally wrapped with additional elements for better text selection * experience and also for line clamping (if `clamp` prop is not set to `false`). */ text?: string; } & CellRendererProps<T> & React.ComponentPropsWithoutRef<'div'>; export declare const DefaultCellContext: React.Context<{ children?: React.ReactNode; expander?: React.ReactNode; shadows?: React.ReactNode; }>; /** * Default cell. * It should be passed to `cellRenderer`. * It can can be used to pass native HTML attributes to the cell container. * @example * { * Header: 'Name', * accessor: 'name', * cellRenderer: (props) => <DefaultCell {...props} />, * } */ export declare const DefaultCell: { <T extends Record<string, unknown>>(props: DefaultCellProps<T>): React.JSX.Element; displayName: string; };