Skip to content

usePreferredColorScheme ​

Hook that returns user preferred color scheme

browser
test coverage
Last changed: last month

Installation ​

Library
CLI
Manual
typescript
import { usePreferredColorScheme } from '@siberiacancode/reactuse';

Usage ​

typescript
const colorScheme = usePreferredColorScheme();

Demo ​

Api ​

Returns

UsePreferredColorSchemeReturn

Type declaration ​

typescript
export type UsePreferredColorSchemeReturn = 'dark' | 'light' | 'no-preference';

Source ​

Source • Demo

Contributors ​

D
debabin
debabin
H
hywax
hywax
P
pPitohu
pPitohu

Released under the MIT License.