# @annotationhub/react-golden-layout

> A multi-screen javascript Layout manager https://golden-layout.com

Latest version **2.3.2** (published 2020-07-15) · MIT license · 0 weekly downloads

## Install

```sh
npm install @annotationhub/react-golden-layout
pnpm add @annotationhub/react-golden-layout
yarn add @annotationhub/react-golden-layout
bun add @annotationhub/react-golden-layout
```

## Health

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

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.3.2 |
| Published | 2020-07-15 |
| First published | 2020-06-30 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 4 |
| Unpacked size | 1.7 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | deepstreamHub GmbH |
| Maintainers | lsimkins |
| Keywords | docking, javascript, layout, layout manager, popouts |

## Links

- npm: https://www.npmjs.com/package/@annotationhub/react-golden-layout
- Homepage: https://github.com/annotationhub/react-golden-layout/issues
- Issues: https://github.com/annotationhub/react-golden-layout/issues
- npm.io page: https://npm.io/package/@annotationhub/react-golden-layout

## Dependencies (4)

- [react](https://npm.io/package/react.md) ^16.13.1
- [zepto](https://npm.io/package/zepto.md) ^1.2.0
- [jquery](https://npm.io/package/jquery.md) ^3.5.0
- [react-dom](https://npm.io/package/react-dom.md) ^16.13.1

## Recent versions

- 2.3.2 (latest) — 2020-07-15
- 3.0.0-beta.11 (beta) — 2020-11-24
- 3.0.0-beta.10 — 2020-11-24
- 3.0.0-beta.9 — 2020-11-24
- 3.0.0-beta.8 — 2020-11-24
- 3.0.0-beta.7 — 2020-11-24
- 3.0.0-beta.6 — 2020-11-24
- 3.0.0-beta.5 — 2020-11-24
- 3.0.0-beta.4 — 2020-11-16
- 3.0.0-beta.3 — 2020-11-16
- 3.0.0-beta.2 — 2020-09-09
- 3.0.0-beta.1 — 2020-09-01
- 3.0.0-beta.0 — 2020-09-01
- 2.3.1 — 2020-07-15
- 2.3.0 — 2020-07-15
- … 6 more at https://npm.io/package/@annotationhub/react-golden-layout/versions

## README

# React Golden Layout
[![NPM version](https://img.shields.io/npm/v/@annotationhub/react-golden-layout)](https://www.npmjs.com/package/@annotationhub/react-golden-layout) [![License](https://img.shields.io/github/license/golden-layout/golden-layout)](https://img.shields.io/github/license/golden-layout/golden-layout)

Original project credit goes to: https://github.com/golden-layout/golden-layout.

## Overview
This project was forked from the original golden layout project, which unfortunately appears to have been abandoned. This is a forked & updated version of that original project to add compatability with React. This updated version now exports a `GoldenLayoutComponent` for easy integration into a React project.

Example usage:
```typescript
import React, { useState } from 'react';
import '@annotationhub/react-golden-layout/dist/css/goldenlayout-base.css';
import '@annotationhub/react-golden-layout/dist/css/themes/goldenlayout-dark-theme.css';
import { GoldenLayoutComponent } from '@annotationhub/react-golden-layout';

function ComponentA() {
  return <h2>A</h2>;
}

function ComponentB() {
  return <h2>B</h2>;
}

function ComponentC(props: any) {
  return <h2>{props.myText}</h2>;
}

export default function GoldenTest() {
  const [layoutManager, setLayoutManager] = useState(null);

  return (
    <div style={{ width: '100%', height: '100%' }}>
      <GoldenLayoutComponent
        // (Required) Golden Layout Config. (See http://golden-layout.com/docs/Config.html)
        config={{
          content: [{
            type: 'row',
            content:[{
              component: ComponentA,
              title: 'A Component'
            }, {
              type: 'column',
              content:[{
                component: ComponentB,
                title: 'B Component'
              },{
                component: () => <ComponentC myText="Component with Props" />,
                title: 'C Component'
              }]
            }]
          }]
        }}
        // (Optional) Set up auto-resizing. Layout will resize when the window resizes.
        autoresize={true}
        // (Optional) (Milliseconds) Debounce resize to prevent excessive re-renders.
        debounceResize={100}
        // (Optional) Grab the instance of the GoldenLayout Manager. Gives you full access to GL API.
        onLayoutReady={setLayoutManager}
      />
    </div>
  );
}
```

## Features

* Full touch support
* Native popup windows
* Completely themeable
* Comprehensive API
* Powerful persistence
* Works in IE8+, Firefox, Chrome
* Reponsive design


## Installation / Usage

To install, run: `npm i -S @annotationhub/react-golden-layout`.

If you are using webpack or another module bundler, you may wish to install it as dev-dep instead. 
We are shipping an UMD version, an ES5 + ES-Module version and an ES2015+ES-Module version of the library within the package.
Modern bundlers such as webpack should pick up the ES2015 version and transpile the code according to your applications configuration.

## Demo App

We have a demo application embedded within this repository, to run it, run:

```sh
git clone github.com/golden-layout/golden-layout
cd golden-layout
npm ci # (or npm i, if you use an old npm version)
npm run start-jquery
# the app is served at localhost:3000 and uses hot-reload, so you can hack right away within the library and the application.
```

## Development

Internally, we are using webpack and babel to have a build process. 
To get started, follow the steps described in demo-app. 
You can get a complete build by running `npm run build`, which will compile all versions of the app into the `dist` folder.

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