Code Monkey home page Code Monkey logo

react-three-next's Introduction

Downloads Discord Shield

๐Ÿฏ React-Three-Next starter

Minimalist starter, First Load JS of 85Kb. This starter will automatically pick the marked R3F components and inject them into a canvas layout so we can navigate seamlessly between the pages with some dynamic dom and canvas content without reloading or creating a new canvas every time.

โšซ Demo :

image

How to use

Installation

Tailwind is the default style. styled-components (styled) is also available.

yarn create r3f-app next my-app
# yarn create r3f-app <next> my-app <tailwind|styled>? -ts?

or

npx create-r3f-app next my-app

๐Ÿ›‚ Typescript

For typescript add the parameter -ts or --typescript:

yarn create r3f-app next my-app -ts

๐Ÿ—ป Features

  • Automatically inject r3f component in the Canvas
  • Support glsl imports
  • PWA Support
  • Layout for Canvas and DOM
  • Template for the meta data and header
  • Clean code using ESlint and Prettier
  • VSCode debug profiles for the server, Chrome, and Firefox

๐Ÿš„ Architecture

Inform the nextjs page that the component is a Threejs component. For that, simply add the r3f property to the parent component.

const Page = (props) => {
  return (
    <>
      <div>Hello !</div>
      
    </>
  )
}
// canvas components goes here
// It will receive same props as Page component (from getStaticProps, etc.)
Page.r3f = (props) => (
  <>
    <Shader />
  </>
)

export default Page

๐ŸŽ›๏ธ Available Scripts

  • yarn dev - Next dev
  • yarn analyze - Generate bundle-analyzer
  • yarn lint - Audit code quality
  • yarn build - Next build
  • yarn start - Next start
  • yarn export - Export to static HTML

โฌ› Stack

How to contribute :

git clone https://github.com/pmndrs/react-three-next
&& cd react-three-next && yarn install

Maintainers :

react-three-next's People

Contributors

agcty avatar alaricbaraou avatar allcontributors[bot] avatar dbismut avatar dependabot-preview[bot] avatar dylantackoor avatar ecklf avatar emalorenzo avatar fackux avatar jameswesc avatar jhsu avatar johnathan-aretos avatar jorgevv avatar njm222 avatar renaudrohlinger avatar sachinraja avatar saravieira avatar shuta13 avatar

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.