Coder Social home page Coder Social logo

davo / react-three-next Goto Github PK

View Code? Open in Web Editor NEW

This project forked from pmndrs/react-three-next

0.0 1.0 0.0 4.81 MB

React Three Fiber, Nextjs, Tailwind and Styled-components starter

Home Page: https://react-three-next.vercel.app/

License: MIT License

JavaScript 95.92% CSS 1.58% GLSL 2.51%

react-three-next's Introduction

David David Downloads Discord Shield Lighthouse Global

๐Ÿฏ React-Three-Next starter

First Load JS of 74Kb. 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 = () => {
  return (
    <>
      <div>Hello !</div>
      {/* Simply add the r3f prop to the parent component -> */}
      <MeshComponent r3f />
    </>
  )
}

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

  • threejs โ€“ A lightweight, 3D library with a default WebGL renderer.
  • @react-three/fiber โ€“ A React renderer for Threejs on the web and react-native.
  • @react-three/drei โ€“ useful helpers for react-three-fiber
  • @react-three/a11y โ€“ Accessibility tools for React Three Fiber
  • tailwind โ€“ A utility-first CSS framework packed with classes like flex, pt-4, text-center and rotate-90 directly in your markup.
  • r3f-perf - Optional โ€“ Tool to easily monitor react threejs performances.

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

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

Watchers

 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.