Working with Cookies 🍪

This example showcases a tab component with persistent state management using cookies. The currently selected tab is saved in a browser cookie, ensuring that the user's preference is preserved between visits. When the page is reloaded or revisited, the component retrieves the saved value and restores the previously selected tab. Client-side cookie operations are handled through the cookie-next library, which simplifies cookie management in Next.js applications.

Also, I took the opportunity to dig into Motion.dev library and create a simple tab component with some shared layout animation between the tabs. I feel that I felt in love ❤️ with the API and how easy it is to create complex animations with it. I can't wait to explore more of its features and create more complex animations with it.

What I've learned?


Let's cook something delicious!

😋