ColorSchemeProvider

ColorSchemeProvider is an optional React context provider to enable dark mode.

also known as Dark Mode, Dark Theme

Props

Component props
Name
Type
Default
children
Required
React.Node
-
colorScheme
"light" | "dark" | "userPreference"
-

The color scheme for components inside the ColorSchemeProvider. Use 'userPreference' to allow the end user to specify the color scheme via their browser settings, using the 'prefers-color-scheme' media query. See color scheme variant for examples.

id
?string
-

An optional id for your color scheme provider. If not passed in, settings will be applied as globally as possible (ex. setting color scheme variables at :root).

Accessibility

Variants

Color scheme

Specify a light or dark color scheme for components

Component quality checklist

Component quality checklist
Quality item
Status
Status description
Figma Library
Component is not currently available in Figma.
Responsive Web
Ready
Component is available in code for web and mobile web.
iOS
Component is not currently available in code for iOS.
Android
Component is not currently available in code for Android.