Deviopath › React

Dark Mode Toggle

Easy · Styling

The outer <div> has the class "light". Clicking the "Toggle theme" button switches it to "dark", and clicking again switches back.

The <p> shows the current theme: "Theme: light" or "Theme: dark".

Next: Color Buttons