This example shows a simple language switching UI in Next.js using React's useState hook. Initially, the language state is set to English ('en'). The UI displays a button labeled 'Switch'. When the user clicks this button, the language state toggles between 'en' and 'es' (Spanish). Each click updates the state, causing React to re-render the component and display content in the selected language. The execution table traces each step: starting with English, switching to Spanish on the first click, back to English on the second click, and so on. The variable tracker shows how the 'lang' variable changes over time. Key moments highlight why state is necessary for UI updates and how React re-renders on state change. The quiz questions test understanding of state changes and UI output at each step. This pattern is common for building accessible, responsive language switchers in modern web apps.