-
1
-
2
-
3
-
4
-
5
-
6
-
7
-
8
-
9
-
10
-
11
-
12
-
13
-
14
-
15
-
16
-
17
-
18
-
19
-
20
-
21
-
22
-
23
-
24
-
25
-
26
-
27
-
28
-
29
-
30
-
31
-
32
-
33
-
34
-
35
-
36
-
37
-
38
-
39
-
40
-
41
# @figspec/react
[](https://github.com/prettier/prettier)
[](https://www.npmjs.com/package/@figspec/react)
A React binding for [`@figspec/components`](https://github.com/pocka/figspec).
## Installation
```sh
# npm
$ npm i @figspec/react
# Yarn
$ yarn add @figspec/react
# pnpm
$ pnpm add @figspec/react
```
## Usage
See the docs at `@figspec/components`.
This bindings enables you to use the CustomElement's property via React's component props.
You don't need to use kebab-case attributes :camel::dash:
```jsx
import { FigspecViewer } from "@figspec/react";
const logSelectedNode = (ev) => {
console.log(ev.detail.selectedNode);
};
<FigspecFrameViewer
nodes={nodes}
renderedImage={renderedImage}
zoomMargin={200}
onNodeSelect={logSelectedNode}
/>;
```