# @types/react-modal-image

> TypeScript definitions for react-modal-image

Latest version **2.6.4** (published 2024-12-27) · MIT license · 0 weekly downloads

## Install

```sh
npm install @types/react-modal-image
pnpm add @types/react-modal-image
yarn add @types/react-modal-image
bun add @types/react-modal-image
```

## Health

**Score 55/100 (C)** — status: stable.

Positive: has types; no vulnerabilities; high maintenance score; popular repo; extremely popular.

Warnings: low downloads; no esm support.

Negative: stale.

## Facts

| | |
|---|---|
| Version | 2.6.4 |
| Published | 2024-12-27 |
| First published | 2023-04-27 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 7.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 51432 |
| Maintainers | types |

## Links

- npm: https://www.npmjs.com/package/@types/react-modal-image
- Repository: https://github.com/DefinitelyTyped/DefinitelyTyped
- Homepage: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react-modal-image
- npm.io page: https://npm.io/package/@types/react-modal-image

## Dependencies (1)

- [@types/react](https://npm.io/package/@types/react.md) *

## Recent versions

- 2.6.4 (latest) — 2024-12-27
- 2.6.3 (ts4.5) — 2023-11-07
- 2.6.0 (ts4.3) — 2023-04-27
- 2.6.2 — 2023-10-18
- 2.6.1 — 2023-09-27

## README

# Installation
> `npm install --save @types/react-modal-image`

# Summary
This package contains type definitions for react-modal-image (https://github.com/aautio/react-modal-image#readme).

# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react-modal-image.
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react-modal-image/index.d.ts)
````ts
import * as React from "react";

export interface ModalImageProps {
    /** Optional. `class` for the small preview image. */
    className?: string | undefined;

    /** Optional. `alt` for the small image and the heading text in Lightbox. */
    alt?: string | undefined;

    /** `src` for the small preview image. */
    small: string;

    /** Optional. `srcSet` for the small preview image. */
    smallSrcSet?: string | undefined;

    /** Optional if `large` is defined. Image shown when zoomed out in Lightbox. */
    medium?: string | undefined;

    /**	Optional if `medium` is defined. Image shown when zoomed in Lightbox. Downloadable. */
    large?: string | undefined;

    /** Optional. Set to `true` to hide download-button from the Lightbox. */
    hideDownload?: boolean | undefined;

    /** Optional. Set to `true` to hide zoom-button from the Lightbox. */
    hideZoom?: boolean | undefined;

    /** Optional. Set to `true` to show rotate-button within the Lightbox. */
    showRotate?: boolean | undefined;

    /** Optional. Background color of the image shown in Lightbox. Defaults to black. Handy for transparent images. */
    imageBackgroundColor?: string | undefined;
}

export interface LightboxProps {
    /** Optional if `large` is defined. Image shown when zoomed out in Lightbox. */
    medium?: string | undefined;

    /**	Optional if `medium` is defined. Image shown when zoomed in Lightbox. Downloadable. */
    large?: string | undefined;

    /** Optional. `alt` for the small image and the heading text in Lightbox. */
    alt?: string | undefined;

    /** Will be invoked when the Lightbox requests to be closed. */
    onClose?: (() => void) | undefined;

    /** Optional. Set to `true` to hide download-button from the Lightbox. */
    hideDownload?: boolean | undefined;

    /** Optional. Set to `true` to hide zoom-button from the Lightbox. */
    hideZoom?: boolean | undefined;

    /** Optional. Set to `true` to show rotate-button within the Lightbox. */
    showRotate?: boolean | undefined;

    /** Optional. Background color of the image shown in Lightbox. Defaults to black. Handy for transparent images. */
    imageBackgroundColor?: string | undefined;
}

declare class ModalImage extends React.Component<ModalImageProps> {}
declare class Lightbox extends React.Component<LightboxProps> {}

export default ModalImage;
export { Lightbox };

````

### Additional Details
 * Last updated: Fri, 27 Dec 2024 21:02:28 GMT
 * Dependencies: [@types/react](https://npmjs.com/package/@types/react)

# Credits
These definitions were written by [Steel](https://github.com/CodeSteel).

---
_Source: https://npm.io/package/@types/react-modal-image · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
