structyl

Init Color Scheme Script API

View component

The full prop reference for the Init Color Scheme Script component. Sets the initial color-scheme attribute before hydration.

Import

tsx
import { InitColorSchemeScript } from '@structyl/styled';

Props

InitColorSchemeScript

Initial color mode script.

PropTypeDefault
storageKey#string

LocalStorage key.

'structyl-mode'
defaultMode#'light' | 'dark' | 'system'

Initial mode fallback.

'system'
attribute#string

Document attribute to set.

'data-theme'

Source code

If you didn't find what you need here, read the component implementation .

structyl — Accessible React Component Library