GithubHelp home page GithubHelp logo

christophertrimboli / plant-fiber-ui Goto Github PK

View Code? Open in Web Editor NEW
8.0 2.0 0.0 2.23 MB

3D UI components for use with react-three-fiber. Includes WebXR support and Typescript driven documentation.

Home Page: https://chriseddy.github.io/plant-fiber-ui-docs/index.html

License: MIT License

JavaScript 20.08% TypeScript 79.92%
threejs reactjs ui-components webxr vr library react-three-fiber

plant-fiber-ui's Introduction

plant-fiber-ui

GitHub license PRs Welcome

3D UI components for use with react-three-fiber. Includes WebXR support and Typescript driven documentation.

The goal of this is to be like the Bootstrap of React threejs.

Open to contributions and feature requests.

IN EARLY DEVELOPMENT

Docs Site: https://chriseddy.github.io/plant-fiber-ui-docs/index.html

Demo Site: https://chriseddy.github.io/plant-fiber-ui-demo/index.html

Glitch Playground: https://glitch.com/edit/#!/plant-fiber-ui

Install

npm install plant-fiber-ui react react-dom react-three-fiber three react-xr

Get Started

Example App.js:

import React from 'react'
import ReactDOM from 'react-dom';
import { Canvas, XRControllers, Box } from 'plant-fiber-ui';

const App = (props) => {
  return (
      <Canvas webxr>
        <ambientLight />
        <pointLight position={[10, 10, 10]} />
        <Box />
        <XRControllers 
        onSelect={(e) => console.log(e)} 
        onSqueezeStart={(e) => console.log(e)} 
        onSelectEnd={(e) => console.log(e)} 
        onAxesChange={((axes, handedness) => console.log(axes, handedness))}
      />
      </Canvas>
  )
}

ReactDOM.render(
  <App/>,
  document.getElementById('root')
);

Components

<Canvas />

Example Usage

<Canvas webxr={true} />

<XRControllers />

Example Usage

  <XRControllers 
    onSelect={(e) => console.log(e)} 
    onSqueezeStart={(e) => console.log(e)} 
    onSelectEnd={(e) => console.log(e)} 
    onAxesChange={((axes, handedness) => console.log(axes, handedness))}
  />

onAxesChange: Function

onSelect: Function

onSelectEnd: Function

onSelectStart: Function

onSqueeze: Function

onSqueezeEnd: Function

onSqueezeStart: Function

<Box />

Example Usage

<Box color='red' position={[-0.5, 2, 1]} />

color: String

Example: color='#808080', color='purple'

position: Array (Vector3)

Example: position={[-0.5, 2, 1]}

onClick: Function

Example: onClick={(e) => yourFunction(e)}

Goals

  • Forms, Buttons, Inputs
  • WebXR
  • Controllers / Hands
  • Assets
  • Panels
  • Layout
  • Keyboard
  • more...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.