Coding a Toggle switch with React.js and Material UI

Hey coders🤓 hope you’re having an amazing day.

I enjoy coding and learning, especially when I know that I can share my experience with my friends on the internet, so that’s why I have coded this very simple minimalist home page with React and Material…


This content originally appeared on DEV Community and was authored by Bek Brace

Hey coders🤓 hope you're having an amazing day.

I enjoy coding and learning, especially when I know that I can share my experience with my friends on the internet, so that's why I have coded this very simple minimalist home page with React and Material UI, but I guess what I wanted to achieve is creating a toggle switch for light and dark mode, something that you can see now in modern websites for readers who prefer to not be bothered by the flashing light - like myself - so this switch provides the option to change the page's color to black and font automatically is converted to white.

I think it's cool, and even cooler to know how you can do it in react, I did not create a component as this was the only component in the app, usually i create components when I have more than one element I want to integrate them; but you can optimize the code as you like.

This is the video, and I hope you will enjoy it 🙂

Follow me on twitter and Instagram : @ BekBrace

Join my Facebook page : @bekbraceinc


This content originally appeared on DEV Community and was authored by Bek Brace


Print Share Comment Cite Upload Translate Updates
APA

Bek Brace | Sciencx (2022-07-03T13:18:39+00:00) Coding a Toggle switch with React.js and Material UI. Retrieved from https://www.scien.cx/2022/07/03/coding-a-toggle-switch-with-react-js-and-material-ui/

MLA
" » Coding a Toggle switch with React.js and Material UI." Bek Brace | Sciencx - Sunday July 3, 2022, https://www.scien.cx/2022/07/03/coding-a-toggle-switch-with-react-js-and-material-ui/
HARVARD
Bek Brace | Sciencx Sunday July 3, 2022 » Coding a Toggle switch with React.js and Material UI., viewed ,<https://www.scien.cx/2022/07/03/coding-a-toggle-switch-with-react-js-and-material-ui/>
VANCOUVER
Bek Brace | Sciencx - » Coding a Toggle switch with React.js and Material UI. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2022/07/03/coding-a-toggle-switch-with-react-js-and-material-ui/
CHICAGO
" » Coding a Toggle switch with React.js and Material UI." Bek Brace | Sciencx - Accessed . https://www.scien.cx/2022/07/03/coding-a-toggle-switch-with-react-js-and-material-ui/
IEEE
" » Coding a Toggle switch with React.js and Material UI." Bek Brace | Sciencx [Online]. Available: https://www.scien.cx/2022/07/03/coding-a-toggle-switch-with-react-js-and-material-ui/. [Accessed: ]
rf:citation
» Coding a Toggle switch with React.js and Material UI | Bek Brace | Sciencx | https://www.scien.cx/2022/07/03/coding-a-toggle-switch-with-react-js-and-material-ui/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.