Which component is used to provide Global Variants when using codegen?
Hey James! We use React contexts to define the global variants in codegen. For example, if you have a global variant called Theme
with a dark
option, you should see a file named PlasmicGlobalVariant__Theme
, and you can set the global variant by wrapping your component in this context
<ThemeContext.Provider value={"dark"}>
...
</ThemeContext.Provider>
You can find more details on this topic in the Plasmic documentation at https://docs.plasmic.app/learn/other-assets/#global-variants=&scheme=codegen.
Let me know if this helps you!