generated fromuiwjs/react-monorepo-template
Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork0
useColorScheme() provides access to the devices color scheme.
License
NotificationsYou must be signed in to change notification settings
uiwjs/react-use-colorscheme
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
useColorScheme() is a tiny, zero-dependency, SSR hook for responding to devices color scheme changes.
npm install @uiw/react-use-colorscheme
importReactfrom"react";import{useColorScheme}from'@uiw/react-use-colorscheme';exportdefaultfunctionApp(){constcolorScheme=useColorScheme();return(<div><h1style={{margin:0}}>useColorScheme</h1><div>{colorScheme==='dark' ?'🌒 dark' :'🌞 light'}</div><p>Test by setting light and dark themes in your OS</p><imgstyle={{maxWidth:520}}src="https://github.com/uiwjs/react-use-online/assets/1680273/38090578-258c-496d-afdb-0493677e12f9"/></div>);}
- useOnline
useOnlineis a tiny, zero-dependency hook for responding to online/offline changes.
As always, thanks to our amazing contributors!
Made withcontributors.
Licensed under the MIT License.
About
useColorScheme() provides access to the devices color scheme.
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Sponsor this project
Uh oh!
There was an error while loading.Please reload this page.
Packages0
No packages published
Uh oh!
There was an error while loading.Please reload this page.