How to Create a Dropdown Button with MaterialUI

To create a drop-down button in MaterialUI, you need to use the components Button, Menu, and MenuItem, as well as track the open state of the menu with useState. Drop-down menus are a great way to present navigation items to your user without taking up a ton of real-estate in your app. As with most … Read more

How to: Create a Simple Navigation Bar in Material UI

You can create a simple navigation bar in Material UI using the AppBar component. Inside of it, use the Toolbar component, buttons, and whatever else you’d like to create your app’s navigation bar. This example uses tinystack as its foundation. If you’re looking for a small, simple, single-container web stack to use as a starting … Read more

How to: Toggle Dark Mode in MUI

You can use React’s useContext and useState hooks to toggle between dark and light mode in Material UI. First create a context and a state in the root of your app. Then, define the toggle function in your context that will modify the state. Finally, call that toggle function from one of the children to … Read more

How to: Dark Mode in Material UI

Enable dark-mode by default in your MUI app by first importing ThemeProvider and createTheme. Then, create your theme with createTheme({palette: {mode: “dark”}}) and pass that as the theme prop for your <ThemeProvider> tag, which will wrap all the components you want the theme applied to. This example uses tinystack as its foundation. If you’re looking … Read more