# react-family-tree

> React component that renders a family tree

Latest version **3.2.0** (published 2022-07-18) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-family-tree
pnpm add react-family-tree
yarn add react-family-tree
bun add react-family-tree
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 3.2.0 |
| Published | 2022-07-18 |
| First published | 2019-01-02 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 4.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 69 |
| Author | Sanich Kotikov |
| Maintainers | sanich |
| Keywords | react, react-component, component, family-tree, family, relatives |

## Links

- npm: https://www.npmjs.com/package/react-family-tree
- Repository: https://github.com/SanichKotikov/react-family-tree
- Issues: https://github.com/SanichKotikov/react-family-tree/issues
- npm.io page: https://npm.io/package/react-family-tree

## Dependencies (1)

- [relatives-tree](https://npm.io/package/relatives-tree.md) 3.2.x

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 3.2.0 (latest) — 2022-07-18
- 3.1.0 — 2021-12-16
- 3.0.0 — 2021-03-20
- 2.0.2 — 2020-07-08
- 2.0.1 — 2020-05-10
- 1.3.0 — 2019-07-26
- 1.2.0 — 2019-01-09
- 1.1.0 — 2019-01-04
- 1.0.0 — 2019-01-03
- 0.0.1 — 2019-01-02

## README

# react-family-tree

React component that renders a family tree.
[Demo](https://sanichkotikov.github.io/react-family-tree-example/).

## Install

```bash
npm i -S react-family-tree
```

## Usage

```jsx
import ReactFamilyTree from 'react-family-tree';
import FamilyNode from './your-components/FamilyNode';

const WIDTH = 70;
const HEIGHT = 80;

<ReactFamilyTree
    nodes={[...]}
    rootId={rootId}
    width={WIDTH}
    height={HEIGHT}
    renderNode={(node) => (
        <FamilyNode
            key={node.id}
            node={node}
            style={{
                width: WIDTH,
                height: HEIGHT,
                transform: `translate(${node.left * (WIDTH / 2)}px, ${node.top * (HEIGHT / 2)}px)`,
            }}
        />
    )}
/>
```

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