@carbon/react
Version:
React components for the Carbon Design System
96 lines (95 loc) • 2.93 kB
TypeScript
/**
* Copyright IBM Corp. 2023, 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 ReactNode, type MouseEvent, type Ref } from 'react';
import { InlineLoadingStatus } from '../InlineLoading/InlineLoading';
export interface SecondaryButtonProps {
buttonText: ReactNode;
onClick(evt: MouseEvent): void;
}
export interface SecondaryButtonSetProps {
closeModal(evt: MouseEvent): void;
disabled?: boolean;
onRequestClose(evt: MouseEvent): void;
secondaryButtonText?: string;
secondaryButtons?: [SecondaryButtonProps, SecondaryButtonProps];
secondaryClassName?: string;
}
export interface ModalFooterProps {
/**
* Pass in content that will be rendered in the Modal Footer
*/
children: ReactNode;
/**
* Specify a custom className to be applied to the Modal Footer container
*/
className?: string;
/**
* Specify an optional function that is called whenever the modal is closed
*/
closeModal?(evt: MouseEvent): void;
/**
* Specify whether the primary button should be replaced with danger button.
* Note that this prop is not applied if you render primary/danger button by yourself
*/
danger?: boolean;
/**
* The `ref` callback for the primary button.
*/
inputref?: Ref<HTMLButtonElement>;
/**
* Specify an optional function for when the modal is requesting to be
* closed
*/
onRequestClose?(): void;
/**
* Specify an optional function for when the modal is requesting to be
* submitted
*/
onRequestSubmit?(): void;
/**
* Specify whether the primary button should be disabled
*/
primaryButtonDisabled?: boolean;
/**
* Specify the text for the primary button
*/
primaryButtonText?: string;
/**
* Specify a custom className to be applied to the primary button
*/
primaryClassName?: string;
/**
* Specify the text for the secondary button
*/
secondaryButtonText?: string;
/**
* Specify an array of config objects for secondary buttons
*/
secondaryButtons?: [SecondaryButtonProps, SecondaryButtonProps];
/**
* Specify a custom className to be applied to the secondary button
*/
secondaryClassName?: string;
/**
* loading status
*/
loadingStatus?: InlineLoadingStatus;
/**
* Specify the description for the loading text
*/
loadingDescription?: string;
/**
* Specify the description for the loading text
*/
loadingIconDescription?: string;
/**
* Provide an optional handler to be invoked when loading is
* successful
*/
onLoadingSuccess?(): void;
}
export declare const ModalFooter: React.ForwardRefExoticComponent<ModalFooterProps & React.RefAttributes<HTMLElement>>;