Placing content in THREE.js is hard. @react-three/flex brings the webs flexbox spec to react-three-fiber. It is based on Yoga, Facebook's open-source layout engine for react-native. Simply create layouts by wrapping your 3D objects in different <Box /> instances inside a <Flex /> container. This way they will be automatically placed in the 3D space following the flexbox specification just like in the DOM. You can tweak the container and the boxes using standard CSS flex properties, like flexDirection or justifyContent for the container and flexGrow for the boxes. There are also shorthands, like align and justify. When positioning items, react-three-flex needs to know where the object anchor is: Yoga Layout expects the object position to be relative to the upper left corner, which is the same as the DOM expects.

Features

  • Invalidation and Reflow
  • Animation with useFrame
  • Axis Orientation
  • Margin and Padding
  • Measure the Container
  • Anchor features

Project Samples

Project Activity

See All Activity >

Categories

3D Modeling

License

MIT License

Follow react-three/flex

react-three/flex Web Site

Other Useful Business Software
Collect! is a highly configurable debt collection software Icon
Collect! is a highly configurable debt collection software

Everything that matters to debt collection, all in one solution.

The flexible & scalable debt collection software built to automate your workflow. From startup to enterprise, we have the solution for you.
Learn More
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of react-three/flex!

Additional Project Details

Programming Language

TypeScript

Related Categories

TypeScript 3D Modeling Software

Registered

2022-02-22