use-prefers-color-scheme
react-hook
Our great sponsors
use-prefers-color-scheme | react-hook | |
---|---|---|
2 | 3 | |
31 | 1,385 | |
- | - | |
3.9 | 0.0 | |
9 months ago | 29 days ago | |
TypeScript | TypeScript | |
MIT License | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
use-prefers-color-scheme
-
Iβve built a fully themeable and accessible dark mode toggle component for React. [Details in the comments]
Thank you! I'm not linking to any articles here. dark-mode-toggle is a controlled React component, so you can query the preferred color scheme with a hook like https://github.com/anatoliygatt/use-prefers-color-scheme and set the mode prop to whatever value you like, as long as it is either dark or light π.
-
Iβve built two React hooks that will help you in making your apps more accessible
π Repository: GitHub π» Live Demo: CodeSandbox
react-hook
-
How to use Resize Observer with React
Our requirements look good and pretty strict, uh? But don't worry, we can deal with all of them using the beautiful and very easy-to-use useResizeObserver hook from the beautiful react-hook library by Jared Lunde. According to it's documentation and my tests and usage as well it meets all our requirements:
-
Concurrent-safe version of useLatest in React?
const useLatest = (current: T) => { const storedValue = React.useRef(current) React.useEffect(() => { storedValue.current = current }) return storedValue} From https://github.com/jaredLunde/react-hook/blob/master/packages/latest/src/index.tsx
-
Best Practices for Publishing Hooks
Here are two solid examples: https://github.com/jaredLunde/react-hook https://github.com/juliencrn/useHooks.ts
What are some alternatives?
use-color - πΌπΌπΌ The powerful color hook that all designers deserve. β¨ Parse and stringify that just works & π¦Ύ Strict type checking at compile time
use-debounce - A debounce hook for react
use-prefers-reduced-motion - πͺ React hook for subscribing to user's motion preference.
usehooks.ts - React hook library, ready to use, written in Typescript. [Moved to: https://github.com/juliencrn/usehooks-ts]
react-as-prop - Type-safe `as` prop utility for flexible and semantic UI components of React
react-use-hotjar - Adds Hotjar capabilities as custom hooks such as init, identify and stateChange
tab-a11y
react-gtm-hook - Easily manage the Google Tag Manager via Hook
resize-observer - Polyfills the ResizeObserver API.
react-spotify-firebase-boilerplate - React boilerplate with Spotify authentication (Authorization Code flow), Firebase, and React Hooks
use-upload - Framework agnostic library handling file uploads with progress, direct to AWS / GCP, and other locations