Code mode lets you generate code in your preferred tech stack using Kombai.
Code mode generates code from Figma designs, images, and text inputs. It is the default selected mode in Kombai. Use it to generate code for small components to full app UIs.
Breaks the design into logical sections. Extracts components, assets, and theme from Figma.
Generates code with higher contextual knowledge of popular frontend libraries and frameworks.
Auto plans before complex tasks. Breaks down the task into sections, features, and editable plan files.
Indexes the codebase and reads relevant files to understand the context better.
Generates the complete working set of code files and assets based on the prompt.
Runs the code locally to preview the working set. Auto-fix TS, compile, and run errors found during the preview generation.
Here’s the workflow you have to follow to generate code using Kombai:
Configure the tech stack
Select the tech stack you want to use for the code generation. Kombai supports a wide range of frameworks and libraries in settings.
Add the input
Add the Figma, text, or image input for which you want to generate code. Kombai will interpret the input and generate a plan for the code.
Review plan
Kombai will provide a detailed plan that includes the sections, features, and editable plan files. Approve the plan to proceed with the code generation.
Verify & preview
Kombai will generate the code based on the plan. You can verify the code and preview in localhost. Kombai will automatically fix the TS, compile, and run errors found during the preview generation.
Iterate
If you find any visual mismatches in the preview, or want to add new features or pages, you can ask Kombai to make the necessary changes. Kombai will regenerate the code accordingly.
Review & save
Once you are satisfied with the preview, you can review and save the files to your repo. Alternatively, you can also set up a new repo and save the files to it.
Kombai will:
Working set refers to the set of files generated by Kombai during the code generation process.
When Kombai is asked to modify the generated code, it also checks for any dependent files in the working set that may require modification. Kombai then proceeds to make the necessary changes and update the working set.
Kombai sets up a local deployment to run the code. It also fixes TS, compile, and run errors found in the build process to ensure that the local server runs smoothly.
If you notice any visual mismatches between the design and the preview, add a follow-up input to Kombai to request changes.
To preview the working set in localhost, click icon in the working set panel.
Kombai maintains the latest version of the code files in the working set. You can read the code of each file before saving it to your system.
Click on a file in the working set panel to open it in a new tab.
Once you are satisfied with the working set preview and code, you can save the files to your repo.
Click Review in the working set panel. Then select the files you want to save, and click Save. You can also click Save All to save all files to the repo.
When no repository is open in the IDE, you can also click Setup and Save to setup a new repository and save the files. You can directly open the repo and run npm run dev
in terminal to preview the generated repo.
Code mode supports all the tech stacks available in Kombai. You can configure it to generate code as per your specific needs. This includes setting the frameworks, state management libraries, component libraries, etc.
For the complete list of supported tech stacks, refer to the Code Settings documentation.