Skip to main content

Modes

Conceptually, supporting light/dark mode is just like adding another variation to your components. The only thing needed is to find a global way to configure that variation.

If you want to use the utility provided by Fast Styles for this, you can wrap your application with the ModeProvider and use the useMode hook to consume or change the mode.

Loading...
note

If you have components with other variants, remember that you can use the compoundVariants attribute to define the behavior of each variant plus the mode, e.g., primary+dark or primary+light.