@carbon/react
Version:
React components for the Carbon Design System
45 lines (44 loc) • 1.79 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 React, { type MouseEventHandler, type PropsWithChildren } from 'react';
import { TableRowProps } from './TableRow';
export interface TableExpandRowProps extends PropsWithChildren<TableRowProps> {
/**
* Space separated list of one or more ID values referencing the TableExpandedRow(s) being controlled by the TableExpandRow
*/
['aria-controls']?: string;
/**
* @deprecated This prop has been deprecated and will be
* removed in the next major release of Carbon. Use the
* `aria-label` prop instead.
*/
ariaLabel?: string;
/**
* Specify the string read by a voice reader when the expand trigger is
* focused
*/
['aria-label']: string;
/**
* The id of the matching th node in the table head. Addresses a11y concerns outlined here: https://www.ibm.com/able/guidelines/ci162/info_and_relationships.html and https://www.w3.org/TR/WCAG20-TECHS/H43
*/
expandHeader?: string;
/**
* The description of the chevron right icon, to be put in its SVG `<title>` element.
*/
expandIconDescription?: string;
/**
* Specify whether this row is expanded or not. This helps coordinate data
* attributes so that `TableExpandRow` and `TableExpandedRow` work together
*/
isExpanded?: boolean;
/**
* Hook for when a listener initiates a request to expand the given row
*/
onExpand: MouseEventHandler<HTMLButtonElement>;
}
declare const TableExpandRow: React.ForwardRefExoticComponent<TableExpandRowProps & React.RefAttributes<HTMLTableCellElement>>;
export default TableExpandRow;