1.3.2 • Published 3 years ago

@cofrico/layout-3d v1.3.2

Weekly downloads
8
License
MIT
Repository
gitlab
Last release
3 years ago

Layout-3d

Layout-3d is build on top of react-three-fiber, a react reconciler for ThreeJS. Is a 3d-editor applications wrapper that helps with common initializations like plan setup, grid, cameras, themes, etc...

NPM JavaScript Style Guide

Install

npm install @cofrico/layout-3d

Usage

import  React  from  'react'
import { Layout } from  '@cofrico/layout-3d'

const  App = () => {
	return {

	<Layout
		dimensions={[70, 50]}
		theme="dark"
	>
		// Put here your 3d components
	</Layout>
	}
}

Options

NameTypeDescriptionDefault
themestring"dark" or "light""dark"
camerastring"perspective" or "orthographic""perspective"
gridboolwhether or not the grid is visibletrue
planboolwhether or not the plan is visibletrue
dimensionsarraywidth, heightdefine the plan dimensions (in meters)50, 50
fileURLstringurl of the file used for plan background''

Hooks

useLayout

Returns the inner state object. It can only be used from <Layout /> children, since its a context who holds the state

Example

You have a simple playground to show the layout working in /example folder. To run it, simply install the dependencies with yarn or npm install and run it from /example directory with yarn start. Then you can go to localhost:3000 to see the example working

License

MIT © Glue Digital(https://github.com/Glue Digital)

1.3.2

3 years ago

1.3.1

3 years ago

1.3.0

3 years ago

1.2.1

4 years ago

1.2.0

4 years ago

1.1.0

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago