{"_id":"@1amageek/use-theme","name":"@1amageek/use-theme","dist-tags":{"canary":"2.1.2","latest":"2.1.2"},"versions":{"2.1.2":{"name":"@1amageek/use-theme","version":"2.1.2","description":"React hook to switch between light and dark themes","keywords":["use-theme"],"author":{"name":"HeroUI","email":"support@heroui.com"},"homepage":"https://heroui.com","license":"MIT","main":"dist/index.js","sideEffects":false,"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/heroui-inc/heroui.git","directory":"packages/hooks/use-theme"},"bugs":{"url":"https://github.com/heroui-inc/heroui/issues"},"peerDependencies":{"react":">=18 || >=19.0.0-rc.0"},"clean-package":"../../../clean-package.config.json","tsup":{"clean":true,"target":"es2019","format":["cjs","esm"]},"module":"dist/index.mjs","types":"dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"},"./package.json":"./package.json"},"scripts":{"build":"tsup src --dts","build:fast":"tsup src","dev":"pnpm build:fast --watch","clean":"rimraf dist .turbo","typecheck":"tsc --noEmit"},"_id":"@1amageek/use-theme@2.1.2","_integrity":"sha512-LyJaYueDQuXpcQRb6gzDibVlc0THgR1TaVvbud9d6hMQK+mrAXp4/oYOb7GV3zXM3nvl5eu3G/s10ZaKYI8LZA==","_resolved":"/private/var/folders/7l/mqtnpbyx6td0z9pbsrgq4c080000gn/T/463d582ac52845eb3756f4c3bcde321d/1amageek-use-theme-2.1.2.tgz","_from":"file:1amageek-use-theme-2.1.2.tgz","_nodeVersion":"20.10.0","_npmVersion":"10.2.3","dist":{"integrity":"sha512-LyJaYueDQuXpcQRb6gzDibVlc0THgR1TaVvbud9d6hMQK+mrAXp4/oYOb7GV3zXM3nvl5eu3G/s10ZaKYI8LZA==","shasum":"6c2bd546cf2b1ae1b157bca11b6183d10d72f742","tarball":"https://registry.npmjs.org/@1amageek/use-theme/-/use-theme-2.1.2.tgz","fileCount":7,"unpackedSize":9502,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDKOjHqWlGOySPcQg3w02q8XRiNsYO5kzKTDoAs7az1uwIgBRVTDN3jA+JJCYNBV59Mk4IwqCBEIeIkwv1bcx8P7/8="}]},"_npmUser":{"name":"1amageek","email":"tmy0x3@icloud.com"},"directories":{},"maintainers":[{"name":"1amageek","email":"tmy0x3@icloud.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/use-theme_2.1.2_1739366493511_0.6237222459652587"},"_hasShrinkwrap":false}},"time":{"created":"2025-02-12T13:21:33.446Z","2.1.2":"2025-02-12T13:21:33.741Z","modified":"2025-02-12T13:21:33.960Z"},"maintainers":[{"name":"1amageek","email":"tmy0x3@icloud.com"}],"description":"React hook to switch between light and dark themes","homepage":"https://heroui.com","keywords":["use-theme"],"repository":{"type":"git","url":"git+https://github.com/heroui-inc/heroui.git","directory":"packages/hooks/use-theme"},"author":{"name":"HeroUI","email":"support@heroui.com"},"bugs":{"url":"https://github.com/heroui-inc/heroui/issues"},"license":"MIT","readme":"# @heroui/use-theme\n\nReact hook to switch between light and dark themes\n\n## Installation\n\n```sh\nyarn add @heroui/use-theme\n# or\nnpm i @heroui/use-theme\n```\n\n## Usage\n\nImport `useTheme`\n\n```tsx\nimport {useTheme} from \"@heroui/use-theme\";\n```\n\n### theme\n\n```tsx\n// `theme` is the active theme name\n// by default, it will use the one in localStorage.\n// if it is no such value in localStorage, `light` theme will be used\nconst {theme} = useTheme();\n```\n\n### setTheme\n\nYou can use any theme name you want, but make sure it exists in your \n`tailwind.config.js` file. See [Create Theme](https://heroui.com/docs/customization/create-theme) for more details.\n\n```tsx\n// set `theme` by using `setTheme`\nconst {setTheme} = useTheme();\n// setting to light theme\nsetTheme('light')\n// setting to dark theme\nsetTheme('dark')\n// setting to purple-dark theme\nsetTheme('purple-dark')\n```\n\n## Contribution\n\nYes please! See the\n[contributing guidelines](https://github.com/heroui-inc/heroui/blob/master/CONTRIBUTING.md)\nfor details.\n\n## License\n\nThis project is licensed under the terms of the\n[MIT license](https://github.com/heroui-inc/heroui/blob/master/LICENSE).\n","readmeFilename":"README.md"}