{"id":23457194,"url":"https://github.com/timonwa/theme-switching-with-react-and-styled-components","last_synced_at":"2025-04-14T02:12:53.532Z","repository":{"id":119085341,"uuid":"473311265","full_name":"Timonwa/theme-switching-with-react-and-styled-components","owner":"Timonwa","description":"Build a React theme switcher app with styled-components","archived":false,"fork":false,"pushed_at":"2023-10-02T21:02:35.000Z","size":2549,"stargazers_count":16,"open_issues_count":0,"forks_count":2,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-04-14T02:12:41.642Z","etag":null,"topics":["article","article-publisher","articles","react","reactjs","styled-components","theme-development","theme-switcher","themes","writing-articles"],"latest_commit_sha":null,"homepage":"https://theme-switching.vercel.app","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Timonwa.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2022-03-23T18:27:29.000Z","updated_at":"2024-04-11T21:25:21.000Z","dependencies_parsed_at":"2023-10-03T05:30:21.082Z","dependency_job_id":null,"html_url":"https://github.com/Timonwa/theme-switching-with-react-and-styled-components","commit_stats":null,"previous_names":["timonwa/theme-switching-with-react-and-styled-components"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Timonwa%2Ftheme-switching-with-react-and-styled-components","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Timonwa%2Ftheme-switching-with-react-and-styled-components/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Timonwa%2Ftheme-switching-with-react-and-styled-components/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Timonwa%2Ftheme-switching-with-react-and-styled-components/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Timonwa","download_url":"https://codeload.github.com/Timonwa/theme-switching-with-react-and-styled-components/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248809051,"owners_count":21164896,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["article","article-publisher","articles","react","reactjs","styled-components","theme-development","theme-switcher","themes","writing-articles"],"created_at":"2024-12-24T04:44:34.906Z","updated_at":"2025-04-14T02:12:53.494Z","avatar_url":"https://github.com/Timonwa.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Theme Switching using Styled Components in ReactJs. :writing_hand:\n\nThis is the code example for my article on [Build a React theme switcher app with styled-components](https://blog.timonwa.com/build-react-theme-switcher-app-styled-components) for LogRocket. Here is the [live demo](https://theme-switching.vercel.app).\n\nVisit my blog, [Timonwa's Notes](https://blog.timonwa.com), for awesome technical content like articles, code snippets, tech goodies, community projects, and more.\n\n## Summary\nUsing the ThemeProvider, a wrapper component available in styled-components, we can quickly set up multiple custom themes in React and switch between them with ease.\n\nTo demonstrate this, we’ll build a React app featuring quotes from popular characters from Game of Thrones. This tutorial will show how to create styled components and multiple themes for the app, change the theme with a click of a button, and save the theme in local storage.\n\n### Breakdown:\n- Why use styled-components for theme switching?\n- Prerequisites\n- Setting up the React app\n- Creating the styled components\n- Creating multiple themes\n- Adding themes with ThemeProvider\n- Switching themes\n- Saving the theme in local storage\n\nPlease give this repo a ⭐ if it was helpful to you.\n\n![short clip of the theme switchhing app](https://user-images.githubusercontent.com/63044364/194694142-309d4dff-f152-4c5d-add8-16e7fcc67112.gif)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimonwa%2Ftheme-switching-with-react-and-styled-components","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftimonwa%2Ftheme-switching-with-react-and-styled-components","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimonwa%2Ftheme-switching-with-react-and-styled-components/lists"}