UNPKG

@payfit/unity-components

Version:

41 lines (40 loc) 1.83 kB
import { default as React } from 'react'; export interface TableRowProps extends React.HTMLAttributes<HTMLTableRowElement> { rowIndex?: number; isSelected?: boolean; } export declare const tableRow: import('tailwind-variants').TVReturnType<{} | {} | {}, undefined, string[], {} | {}, undefined, import('tailwind-variants').TVReturnType<unknown, undefined, string[], unknown, unknown, undefined>>; /** * The `TableRow` component renders a row in the table, containing cells of data. * It automatically processes its children to add row and column indices and handles selection state. * @param {TableRowProps} props - The props for the `TableRow` component * @param {ReactNode} props.children - The cells to render (typically TableCell components) * @param {number} [props.rowIndex=0] - The index of the row (automatically set by TableBody) * @param {boolean} [props.isSelected] - Whether the row is selected * @example * ```tsx * import { TableRow, TableCell } from '@payfit/unity-components' * * <TableRow> * <TableCell isRowHeader>John Doe</TableCell> * <TableCell>john.doe@example.com</TableCell> * <TableCell>Engineering</TableCell> * </TableRow> * ``` * @example * ```tsx * // With selection * import { TableRow, TableCell } from '@payfit/unity-components' * * <TableRow isSelected={true}> * <TableCell>Selected row content</TableCell> * </TableRow> * ``` * @see {@link TableRowProps} for all available props * @see {@link TableCell} for the cell component * @remarks * {@link https://unity-components.payfit.io/?path=/story/data-table-tablerow--docs|API and Demos} • * {@link https://payfit.design|Design docs} */ declare const TableRow: React.MemoExoticComponent<React.ForwardRefExoticComponent<TableRowProps & React.RefAttributes<HTMLTableRowElement>>>; export { TableRow };