This is a solution to the Planets fact site challenge on Frontend Mentor. Frontend Mentor challenges help you improve your coding skills by building realistic projects.
Users should be able to:
- View the optimal layout for the app depending on their device's screen size
- See hover states for all interactive elements on the page
- View each planet page and toggle between "Overview", "Internal Structure", and "Surface Geology"
- Solution URL: Add solution URL here
- Live Site URL: Add live site URL here
- Semantic HTML5 markup
- Tailwind custom properties
- React - JS library
- Next.js - React framework
- tailwindCSS - For styles
- Zustand - A small, fast and scalable bearbones state-management solution using simplified flux principles.
The application of the state management Zustand in a very simple context.
import { create } from "zustand";
const usePlanets = create((set) => ({
planet: 0,
choose: (index) => set(() => ({ planet: index })),
}));
export default usePlanets;
There is a lot more to explore in the Zustand context.
- Zustand/NextJS - "State Management using Zustand In Nextjs 13.4 and React"
- Website - Thomas Tschoepke Soares
- Frontend Mentor - @ttsoares
- Conditional TW classes - How to apply clxs and tailwind-merge to manage conditional Tailwind classes.