I'm excited to share DIVZ - a free open source React UI component that lets you scroll, swipe & zoom through HTML elements on the 3D z-axis. Think of it as a new, experimental way to navigate and present web content 🙌
👉 Try out the demos here 👈
👉 Dive into the source code 👈
Installation
Developers can install Divz as an open source component to use in React apps. Quickest install method is via the npm install command below:
npm install divz
Usage
After install, import the component and render it in your app or page, wrapping it around your list of divs or other HTML elements:
import { Divz } from "divz";
function App() {
return (
<Divz>
<div>1</div>
<div>2</div>
<div>3</div>
<div>4</div>
</Divz>
);
}
The demo source code illustrates how the component can be initialised with more props - along with images and videos inside the child divs - for a richer user experience.
Why Divz?
Divz was initially created to showcase portfolio work within a pseudo-3D environment, loosely inspired by Apple's Time Machine interface which allows the user to zoom through historical Finder windows:
What Sets It Apart?
- Simplified Integration: Divz is designed to be responsive and easy to use, acting as a straightforward wrapper around a list of divs or other HTML elements.
- Diverse Applications: While the demos showcase its versatility as a carousel, slideshow, or gallery component, Divz opens the door to a range of other potential uses. Consider it an innovative, experimental method for navigating web content.
- Broad Device Support: Divz accommodates various navigation modes, including touch for mobile devices, cursor/trackpad for desktop users, and arrow keys for TV devices.
How Does It Work?
Under the hood, Divz performs CSS3 transforms on the core component and the child HTML elements, set dynamically with React TypeScript. The component is packaged using Vite to allow npm library integration.
Support
I hope this has given a good intro to the component and you get some use out of it for your own projects!
💬 Fire over a comment if you have any feedback, requests or issues 🐛
⭐ Give it a Github star if you like the component or want to bookmark it 🙏
Top comments (36)
Definitely am gonna try this and may even use this for the dev Netlify challenge!
Awesome, let me know how you get on!
Wow, this is dope! And free!! 🙌
Thanks for checking it out!
Looks cool, will try it out 🌟
Cheers!
So cool!! It looks really awesome!! 💯
nice one, I appreciate it 🙏
Great job! 👏 so cool! 😎
much appreciated, cheers!
This is great! I'm trying to use it but keep getting an error around the useRef. I'll dig a little more. Really nice, though
I've got a bare-bones demo running in codepen with React 18.3.1 - codepen.io/lewhunt/pen/LYoPaoN
I've also just bumped up divz to v1.1.5 that uses react as peerDependencies instead of dependencies, that might help with the issue you face
thanks! Yeah that's a common issue with npm libraries in React due to mismatched versions. Did you try a clean npm install of divz in your app, rather than copying the source directory?
Looking really good! Could we contribute to it? :))
Thanks, great to hear! While it's early days I'm focused on maintaining the project's initial direction and quality. However, I'm definitely open to discussing potential contributions, feel free to share your ideas on GitHub!
This looks so cool!
It's so nice ,,, thank you
So Cool!