# @types/react-cytoscapejs

> TypeScript definitions for react-cytoscapejs

Latest version **1.2.6** (published 2025-10-10) · MIT license · 0 weekly downloads

## Install

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

## Health

**Score 65/100 (B)** — status: stable.

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

Warnings: low downloads; no esm support.

## Facts

| | |
|---|---|
| Version | 1.2.6 |
| Published | 2025-10-10 |
| First published | 2020-06-23 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 6.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 51435 |
| Maintainers | types |

## Links

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

## Dependencies (2)

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

## Recent versions

- 1.2.6 (latest) — 2025-10-10
- 1.2.5 (ts4.5) — 2023-11-07
- 1.2.2 (ts3.6) — 2021-07-08
- 1.2.1 (ts3.5) — 2021-04-02
- 1.2.0 (ts3.3) — 2020-12-08
- 1.1.2 (ts3.2) — 2020-11-09
- 1.1.0 (ts3.1) — 2020-06-23
- 1.2.4 — 2023-10-18
- 1.2.3 — 2023-09-27
- 1.1.1 — 2020-09-16

## README

# Installation
> `npm install --save @types/react-cytoscapejs`

# Summary
This package contains type definitions for react-cytoscapejs (https://github.com/plotly/react-cytoscapejs).

# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react-cytoscapejs.
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react-cytoscapejs/index.d.ts)
````ts
import cytoscape = require("cytoscape");
import { Component, CSSProperties } from "react";

interface CytoscapeComponentProps {
    id?: string | undefined;
    cy?: ((cy: cytoscape.Core) => void) | undefined;
    style?: CSSProperties | undefined;
    elements: cytoscape.ElementDefinition[];
    layout?: cytoscape.LayoutOptions | undefined;
    stylesheet?: cytoscape.StylesheetJsonBlock | cytoscape.StylesheetJsonBlock[] | string | undefined;
    className?: string | undefined;
    zoom?: number | undefined;
    pan?: cytoscape.Position | undefined;
    minZoom?: number | undefined;
    maxZoom?: number | undefined;
    zoomingEnabled?: boolean | undefined;
    userZoomingEnabled?: boolean | undefined;
    boxSelectionEnabled?: boolean | undefined;
    autoungrabify?: boolean | undefined;
    autounselectify?: boolean | undefined;
    panningEnabled?: boolean | undefined;
    userPanningEnabled?: boolean | undefined;
    autolock?: boolean | undefined;
    get?: ((obj: Record<string, any>, key: string) => any) | undefined;
    toJson?: ((obj: Record<string, any>) => any) | undefined;
    diff?: ((objA: Record<string, any>, objB: Record<string, any>) => boolean) | undefined;
    forEach?: (<T>(list: T[], iterator: (value: T, index: number, array: T[]) => void) => void) | undefined;
    headless?: boolean | undefined;
    styleEnabled?: boolean | undefined;
    hideEdgesOnViewport?: boolean | undefined;
    textureOnViewport?: boolean | undefined;
    motionBlur?: boolean | undefined;
    motionBlurOpacity?: number | undefined;
    wheelSensitivity?: number | undefined;
    pixelRatio?: number | string | undefined;
}

declare class CytoscapeComponent extends Component<CytoscapeComponentProps> {
    static normalizeElements(
        data:
            | {
                nodes: cytoscape.ElementDefinition[];
                edges: cytoscape.ElementDefinition[];
            }
            | cytoscape.ElementDefinition[],
    ): cytoscape.ElementDefinition[];
}

export default CytoscapeComponent;

````

### Additional Details
 * Last updated: Fri, 10 Oct 2025 07:33:01 GMT
 * Dependencies: [@types/react](https://npmjs.com/package/@types/react), [cytoscape](https://npmjs.com/package/cytoscape)

# Credits
These definitions were written by [ Emmanuel Counasse](https://github.com/manuc66), and [newraina](https://github.com/newraina).

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