@carbon/react
Version:
React components for the Carbon Design System
58 lines (57 loc) • 1.8 kB
TypeScript
/**
* Copyright IBM Corp. 2016, 2023
*
* 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 ReactNode, type MouseEvent, type HTMLAttributes } from 'react';
export type DivProps = Omit<HTMLAttributes<HTMLDivElement>, 'title'>;
export interface ModalHeaderProps extends DivProps {
/**
* Provide an optional function to be called when the close button is
* clicked
*/
buttonOnClick?(event: MouseEvent): void;
/**
* Specify the content to be placed in the ModalHeader
*/
children?: ReactNode;
/**
* Specify an optional className to be applied to the modal header
*/
className?: string;
/**
* Specify an optional className to be applied to the modal close node
*/
closeClassName?: string;
/**
* Specify an optional className to be applied to the modal close icon node
*/
closeIconClassName?: string;
/**
* Provide an optional function to be called when the modal is closed
*/
closeModal?(event: MouseEvent): void;
/**
* Specify a description for the close icon that can be read by screen
* readers
*/
iconDescription?: string;
/**
* Specify an optional label to be displayed
*/
label?: ReactNode;
/**
* Specify an optional className to be applied to the modal header label
*/
labelClassName?: string;
/**
* Specify an optional title to be displayed
*/
title?: ReactNode;
/**
* Specify an optional className to be applied to the modal heading
*/
titleClassName?: string;
}
export declare const ModalHeader: React.ForwardRefExoticComponent<ModalHeaderProps & React.RefAttributes<HTMLDivElement>>;