Skip to content

usePreferredColorScheme

Hook that returns user preferred color scheme

user
medium
test coverage
Last changed: 7 months ago

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

SourceDemo

Contributors

D
debabin
debabin
H
hywax
hywax
P
pPitohu
pPitohu

Released under the MIT License.