@navikt/ds-react
Version:
React components from the Norwegian Labour and Welfare Administration.
51 lines (50 loc) • 1.4 kB
TypeScript
import React from "react";
import { RowProps } from "./Row.js";
export interface ExpandableRowProps extends Omit<RowProps, "content" | "onRowClick"> {
/**
* Content of the expanded row
*/
content: React.ReactNode;
/**
* Placement of toggle button
* @default "left"
*/
togglePlacement?: "left" | "right";
/**
* Opens component if 'true', closes if 'false'
* Using this prop removes automatic control of open-state
*/
open?: boolean;
/**
* Opened state default
* @default false
*/
defaultOpen?: boolean;
/**
* Change handler for open
*/
onOpenChange?: (open: boolean) => void;
/**
* Disable expansion. shadeOnHover will not be visible.
* @default false
*/
expansionDisabled?: boolean;
/**
* Makes the whole row clickable
* @default false
*/
expandOnRowClick?: boolean;
/**
* The width of the expanded row's internal cell
* @default 999
*/
colSpan?: number;
/**
* Optional left, right-gutter for content
* @default Same as `togglePlacement`
*/
contentGutter?: "left" | "right" | "none";
}
export type ExpandableRowType = React.ForwardRefExoticComponent<ExpandableRowProps & React.RefAttributes<HTMLTableRowElement>>;
export declare const ExpandableRow: ExpandableRowType;
export default ExpandableRow;