Exporting Design Tokens

useDesignTokens supports the DTCG specification and allows you import and export your tokens in JSON format.

  • Go to the export settings tab and specify the export task settings. This includes
    1. Selecting which token tiers will be exported (all or selected tiers only)

    2. Which token types will be exported (all or selected types only)

    3. Handling contextual overrides.

      You can choose to export tokens only for a single context by selecting the context. Alternatively, you can decide if all tokens will be exported in a single file with separate folders for each context, or if each context will be exported in a separate file.

    4. Choose how alias or reference tokens will be resolved, whether by using the referenced token's raw value or by using the name of the referenced tokens as the value.
  • Preview generated JSON file(s): Once you've configured the export settings, you can preview the generated JSON file(s). This allows you to review the exported tokens before downloading or integrating them into a repository. You can copy the JSON code or download it as a file for further use.

  • Define integrations for GitHub or GitLab repositories: If you want to push the generated JSON file(s) to a GitHub or GitLab repository, you can define integrations within the export settings. This allows you to automate the process of exporting tokens and pushing them to a version control repository.

  • Generate API key and URL: You can also generate an API key within the export settings. This key, along with the API URL, allows you to run the export task at the time of calling the API endpoint. This makes it possible to automate the export process through API calls and download the exported JSON code again in JSON format.