3.0.4 • Published 3 months ago

@anton.bobrov/react-dat-gui v3.0.4

Weekly downloads
-
License
MIT
Repository
github
Last release
3 months ago

React hooks for dat.gui

React adaptation of dat.GUI

See Docs

Installation

npm i "@anton.bobrov/react-dat-gui"

Create a single dat.GUI folder

const folder = useDatGuiFolder({ name: 'folder name' });

Create settings

const gui = useDatGuiSettings({
  name: 'settings folder',
  isOpen: true,
  source: {
    isEnabled: true,
    ease: 1,
    color: 0xff00ff,
  },
  controls: [
    { name: 'isEnabled', type: 'boolean' },
    { name: 'ease', type: 'number', min: 0, max: 1, step: 0.01 },
    { name: 'color', type: 'color' },
  ],
  onChange(object) {
    console.log(object);
  },
});

Disable dat.GUI

To disable dat.GUI, add this code to head tag

<script>
  window.USE_DAT_GUI = false;
</script>
3.0.4

3 months ago

3.0.3

3 months ago

3.0.2

3 months ago

3.0.1

3 months ago

3.0.0

3 months ago

2.1.3

4 months ago

2.1.2

5 months ago

2.1.1

5 months ago

2.1.0

6 months ago

2.0.1

6 months ago

2.0.0

7 months ago

1.3.10

10 months ago

1.3.9

10 months ago

1.3.8

10 months ago

1.3.13

9 months ago

1.3.14

7 months ago

1.3.11

10 months ago

1.3.12

9 months ago

1.3.17

7 months ago

1.3.18

7 months ago

1.3.15

7 months ago

1.3.16

7 months ago

1.3.7

11 months ago

1.3.6

11 months ago

1.3.5

11 months ago

1.3.4

11 months ago

1.3.3

12 months ago

1.3.2

12 months ago

1.3.1

12 months ago

1.3.0

12 months ago