Dynamically passing tokens to code components

Dynamically creating a theme object

Once tokens are in Interplay they can be dynamically passed to your components as a theme object, if your code components support that. This allows you to edit tokens in Interplay and interactively see the effect of your changes on your components.

To set this up usually requires:

  • Creating a wrapper component that accepts the theme data as an object and sets this in the ThemeProvider for your components.
  • Create an extension of type computedValue in your project settings that scripts the conversion of your live tokens data into a theme object.
  • Edit the properties of your wrapper component to use the computedValue property.

Please contact us for help in setting this up for your components.

Next: Upgrading the CLI