<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Darshan Rajadhyaksha</title>
    <description>The latest articles on DEV Community by Darshan Rajadhyaksha (@darshan_rajadhyaksha).</description>
    <link>https://dev.to/darshan_rajadhyaksha</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4062154%2Ffdd39557-793b-4aee-9139-94e5c9659686.jpeg</url>
      <title>DEV Community: Darshan Rajadhyaksha</title>
      <link>https://dev.to/darshan_rajadhyaksha</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/darshan_rajadhyaksha"/>
    <language>en</language>
    <item>
      <title>Build Interactive 3D Hover Cards in React with Almost No Effort</title>
      <dc:creator>Darshan Rajadhyaksha</dc:creator>
      <pubDate>Tue, 04 Aug 2026 09:45:26 +0000</pubDate>
      <link>https://dev.to/darshan_rajadhyaksha/build-interactive-3d-hover-cards-in-react-with-almost-no-effort-70p</link>
      <guid>https://dev.to/darshan_rajadhyaksha/build-interactive-3d-hover-cards-in-react-with-almost-no-effort-70p</guid>
      <description>&lt;h2&gt;
  
  
  Try it yourself
&lt;/h2&gt;

&lt;p&gt;You can see the live demo and copy the code here: &lt;a href="https://mosaicui.com/components/tilt-3d/" rel="noopener noreferrer"&gt;https://mosaicui.com/components/tilt-3d/&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Why I built this component
&lt;/h2&gt;

&lt;p&gt;There are plenty of 3D tilt libraries out there, but many are difficult to customize or don't fit well into modern React projects.&lt;/p&gt;

&lt;p&gt;The goal with this component was to keep things simple.&lt;/p&gt;

&lt;p&gt;It uses &lt;strong&gt;Tailwind CSS&lt;/strong&gt; for styling and &lt;strong&gt;Motion&lt;/strong&gt; for smooth animations.&lt;/p&gt;

&lt;p&gt;Instead of installing another UI library, you can simply:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Copy the component&lt;/li&gt;
&lt;li&gt;Paste it into your project&lt;/li&gt;
&lt;li&gt;Customize it however you like&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You own the code, so you can change the animation, styling, or behavior to match your design.&lt;/p&gt;




&lt;h2&gt;
  
  
  Two Components, More Control
&lt;/h2&gt;

&lt;p&gt;The effect is built using two components:&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;code&gt;Tilt3D&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;Tilt3D&lt;/code&gt; is the parent component.&lt;/p&gt;

&lt;p&gt;Wrap your card or any content inside it, and it handles the 3D tilt effect.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;code&gt;Tilt3DElement&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;Use &lt;code&gt;Tilt3DElement&lt;/code&gt; for the parts you want to stand out.&lt;/p&gt;

&lt;p&gt;For example:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Product image&lt;/li&gt;
&lt;li&gt;Title&lt;/li&gt;
&lt;li&gt;Button&lt;/li&gt;
&lt;li&gt;Badge&lt;/li&gt;
&lt;li&gt;Icon&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These elements move slightly closer to the user, creating a layered 3D effect instead of everything moving together.&lt;/p&gt;

&lt;p&gt;This gives your cards a more realistic and interactive feel while keeping the API simple.&lt;/p&gt;




&lt;h2&gt;
  
  
  How it works behind the scenes
&lt;/h2&gt;

&lt;p&gt;The component listens to the mouse position inside the &lt;code&gt;Tilt3D&lt;/code&gt; container.&lt;/p&gt;

&lt;p&gt;As the cursor moves, it calculates how far the mouse is from the center of the card and updates the rotation using CSS &lt;code&gt;rotateX&lt;/code&gt; and &lt;code&gt;rotateY&lt;/code&gt; transforms.&lt;/p&gt;

&lt;p&gt;To create depth, &lt;code&gt;Tilt3DElement&lt;/code&gt; uses the CSS &lt;code&gt;translateZ&lt;/code&gt; property. Elements with a higher &lt;code&gt;translateZ&lt;/code&gt; value appear closer to the user, making them stand out from the rest of the card.&lt;/p&gt;

&lt;p&gt;The animations are powered by &lt;strong&gt;Motion&lt;/strong&gt;, which keeps the movement smooth, while &lt;strong&gt;Tailwind CSS&lt;/strong&gt; handles the styling.&lt;/p&gt;




&lt;h2&gt;
  
  
  Support the Project
&lt;/h2&gt;

&lt;p&gt;If you found this component useful, please consider giving the project a ⭐ on GitHub. It really helps!&lt;/p&gt;

&lt;p&gt;I'd love to see what you build or hear your feedback.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/darshan-rajadhyaksha/MosaicUI" rel="noopener noreferrer"&gt;https://github.com/darshan-rajadhyaksha/MosaicUI&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Happy building! 🚀&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>react</category>
      <category>frontend</category>
    </item>
  </channel>
</rss>
