Articles on: Code export

View code and export

Now that you visually built a project let's see the code behind it and learn how to export it.



View code
Export code

1. View code



Whilte building your project you can check the Code Panel that is populated behind the scenes with the generated code based on the changes you are doing in stage.
To do that, go in the top right side of the Teleport and press on the Code button. This will open a modal for code, publish and download.

By default, the generators are set to display our UIDL in React.js format. The UIDL (User Interface Definition Language) is the backbone of our generators.

You can change the format of the code into many flavours of Javascript such as:

ReactVueAngularHTML&CSSUIDL


Along with that there are multiple ways to structure the CSS of a project that you can choose from as well. The CSS formats that we support are:

Inline StylesPlain CSSStyled JSXCSS Modules
Styled ComponentsReact JSS


What you have selected as a page or component will be shown in code format in the Code Panel.
You can also quickly copy the code and use it somewhere else.

2. Export Code



To export the code, click on the Code button on the Top Bar and go to the Download tab.

Exporting the code that is automatically generated is easy and it comes with a lot of options.
Everything is batched into a project that is build on top of the Next.js framework.

First, you need to select the JS framework you want to export your project as. Then you have a few options.

Export to Codesandbox


After selecting a framework, you can choose to continue to work on the project using Codesandbox.

Export to Github



Another option is to take the project on Github. To do this you will need to go in Project Settings and copy the Github Token there. After that, clicking on the Github icon in the Export menu will take you to the created project.

Save to local



The last option is to download the code as a zip file and save it on your local machine.

View code and download as zip in TeleportHQ

Updated on: 26/02/2024

Was this article helpful?

Share your feedback

Cancel

Thank you!