• Version 3.16.3
  • Published
  • 10.4 kB
  • 1 dependency
  • MIT license


npm i @types/react-modal
yarn add @types/react-modal
pnpm add @types/react-modal


TypeScript definitions for react-modal



class ReactModal

class ReactModal extends React.Component<ReactModal.Props> {}

    property defaultStyles

    static defaultStyles: ReactModal.Styles;

      property portal

      portal: { overlay: null | HTMLDivElement; content: null | HTMLDivElement };

        method setAppElement

        static setAppElement: (appElement: string | HTMLElement) => void;
        • Call this to properly hide your application from assistive screenreaders and other assistive technologies while the modal is open.


        interface Aria

        interface Aria {}

          property describedby

          describedby?: string | undefined;
          • Identifies the element (or elements) that describes the object.

          property labelledby

          labelledby?: string | undefined;
          • Defines a string value that labels the current element.

          property modal

          modal?: boolean | 'false' | 'true' | undefined;
          • Indicates whether an element is modal when displayed.

          interface Classes

          interface Classes {}

            property afterOpen

            afterOpen: string;

              property base

              base: string;

                property beforeClose

                beforeClose: string;

                  interface OnAfterOpenCallback

                  interface OnAfterOpenCallback {}
                  • Describes unction that will be run after the modal has opened

                  call signature

                  (obj?: OnAfterOpenCallbackOptions): void;

                    interface OnAfterOpenCallbackOptions

                    interface OnAfterOpenCallbackOptions {}
                    • Describes overlay and content element references passed to onAfterOpen function

                    property contentEl

                    contentEl: HTMLDivElement;
                    • content element reference

                    property overlayEl

                    overlayEl: Element;
                    • overlay element reference

                    interface Props

                    interface Props {}

                      property appElement

                      appElement?: HTMLElement | HTMLElement[] | HTMLCollection | NodeList | undefined;

                        property aria

                        aria?: Aria | undefined;

                          property ariaHideApp

                          ariaHideApp?: boolean | undefined;

                            property bodyOpenClassName

                            bodyOpenClassName?: string | null | undefined;

                              property children

                              children?: React.ReactNode;

                                property className

                                className?: string | Classes | undefined;

                                  property closeTimeoutMS

                                  closeTimeoutMS?: number | undefined;

                                    property contentElement

                                    | ((
                                    props: React.ComponentPropsWithRef<'div'>,
                                    children: React.ReactNode
                                    ) => React.ReactElement)
                                    | undefined;

                                      property contentLabel

                                      contentLabel?: string | undefined;

                                        property contentRef

                                        contentRef?: ((instance: HTMLDivElement) => void) | undefined;

                                          property data

                                          data?: any;

                                            property htmlOpenClassName

                                            htmlOpenClassName?: string | null | undefined;

                                              property id

                                              id?: string | undefined;

                                                property isOpen

                                                isOpen: boolean;

                                                  property onAfterOpen

                                                  onAfterOpen?: OnAfterOpenCallback | undefined;

                                                    property overlayClassName

                                                    overlayClassName?: string | Classes | undefined;

                                                      property overlayElement

                                                      | ((
                                                      props: React.ComponentPropsWithRef<'div'>,
                                                      contentEl: React.ReactElement
                                                      ) => React.ReactElement)
                                                      | undefined;

                                                        property overlayRef

                                                        overlayRef?: ((instance: HTMLDivElement) => void) | undefined;

                                                          property portalClassName

                                                          portalClassName?: string | undefined;

                                                            property preventScroll

                                                            preventScroll?: boolean | undefined;

                                                              property role

                                                              role?: string | null | undefined;

                                                                property shouldCloseOnEsc

                                                                shouldCloseOnEsc?: boolean | undefined;

                                                                  property shouldCloseOnOverlayClick

                                                                  shouldCloseOnOverlayClick?: boolean | undefined;

                                                                    property shouldFocusAfterRender

                                                                    shouldFocusAfterRender?: boolean | undefined;

                                                                      property shouldReturnFocusAfterClose

                                                                      shouldReturnFocusAfterClose?: boolean | undefined;

                                                                        property style

                                                                        style?: Styles | undefined;

                                                                          property testId

                                                                          testId?: string | undefined;

                                                                            method onAfterClose

                                                                            onAfterClose: () => void;

                                                                              method onRequestClose

                                                                              onRequestClose: (event: React.MouseEvent | React.KeyboardEvent) => void;

                                                                                method parentSelector

                                                                                parentSelector: () => HTMLElement;

                                                                                  interface Styles

                                                                                  interface Styles {}

                                                                                    property content

                                                                                    content?: React.CSSProperties | undefined;

                                                                                      property overlay

                                                                                      overlay?: React.CSSProperties | undefined;

                                                                                        Package Files (1)

                                                                                        Dependencies (1)

                                                                                        Dev Dependencies (0)

                                                                                        No dev dependencies.

                                                                                        Peer Dependencies (0)

                                                                                        No peer dependencies.


                                                                                        To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

                                                                                        You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/@types/react-modal.

                                                                                        • Markdown
                                                                                        • HTML
                                                                                          <a href="https://www.jsdocs.io/package/@types/react-modal"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>