@carbon/react
Version:
React components for the Carbon Design System
84 lines (83 loc) • 2.97 kB
TypeScript
/**
* Copyright IBM Corp. 2016, 2025
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/
import { PropsWithChildren } from 'react';
import PropTypes from 'prop-types';
export interface TableProps {
experimentalAutoAlign?: boolean;
className?: string;
/**
* `false` If true, will apply sorting styles
*/
isSortable?: boolean;
/**
* Specify whether the overflow menu (if it exists) should be shown always, or only on hover
*/
overflowMenuOnHover?: boolean;
/**
* Change the row height of table. Currently supports `xs`, `sm`, `md`, `lg`, and `xl`.
*/
size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
/**
* `false` If true, will keep the header sticky (only data rows will scroll)
*/
stickyHeader?: boolean;
/**
* `false` If true, will use a width of 'auto' instead of 100%
*/
useStaticWidth?: boolean;
/**
* `true` to add useZebraStyles striping.
*/
useZebraStyles?: boolean;
/**
* Specify the table tabIndex
*/
tabIndex?: number;
}
export declare const Table: {
({ className, children, useZebraStyles, size, isSortable, useStaticWidth, stickyHeader, overflowMenuOnHover, experimentalAutoAlign, tabIndex, ...other }: PropsWithChildren<TableProps>): import("react/jsx-runtime").JSX.Element;
propTypes: {
/**
* Pass in the children that will be rendered within the Table
*/
children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
className: PropTypes.Requireable<string>;
/**
* Experimental property. Allows table to align cell contents to the top if there is text wrapping in the content. Might have performance issues, intended for smaller tables
*/
experimentalAutoAlign: PropTypes.Requireable<boolean>;
/**
* `false` If true, will apply sorting styles
*/
isSortable: PropTypes.Requireable<boolean>;
/**
* Specify whether the overflow menu (if it exists) should be shown always, or only on hover
*/
overflowMenuOnHover: PropTypes.Requireable<boolean>;
/**
* Change the row height of table. Currently supports `xs`, `sm`, `md`, `lg`, and `xl`.
*/
size: PropTypes.Requireable<string>;
/**
* `false` If true, will keep the header sticky (only data rows will scroll)
*/
stickyHeader: PropTypes.Requireable<boolean>;
/**
* `false` If true, will use a width of 'auto' instead of 100%
*/
useStaticWidth: PropTypes.Requireable<boolean>;
/**
* `true` to add useZebraStyles striping.
*/
useZebraStyles: PropTypes.Requireable<boolean>;
/**
* Specify the table tabIndex
*/
tabIndex: PropTypes.Requireable<number>;
};
};
export default Table;