get_jsx converts it to a React component you can drop straight into your codebase. The tool handles the HTML-to-JSX transformation — attribute renaming, self-closing tags, style extraction — and gives you a choice of how CSS lands in the output: as Tailwind className strings or as a style prop object. This guide covers both modes, shows you how to scope the export to a specific component, and walks through saving the result as a .tsx file.
Prerequisites
- A design on the canvas with at least one component ready to export
- Your agent connected and
pingreturning{ pong: true }(see Design with an agent)
Choosing an export mode
get_jsx accepts an optional mode parameter with two values:
tailwind (default)
Preserves
className on every element. CSS properties that map directly to Tailwind utilities — padding, margin, color, background-color, width, height, display, flex-direction — are dropped from the inline style prop and kept as class names. Use this when your React project already uses Tailwind.inline
Converts every CSS property to a JSX
style object. No Tailwind dependency required. Use this when you’re importing into a project that uses CSS Modules, styled-components, or plain CSS.Export the full canvas
To export everything on the canvas as a single component, callget_jsx with no arguments:
"tailwind". The response contains a self-contained JSX string:
Export a single component
When the canvas has multiple sections, scope the export to just the element you need by passing itscomponentId:
Tailwind mode in detail
Intailwind mode the agent outputs className props and omits a style prop for any property that Tailwind can express natively. The properties that get this treatment are:
Properties that don’t have a direct Tailwind mapping (such as
border-radius on an arbitrary pixel value, or letter-spacing) are preserved in the style prop alongside className.
Example output — tailwind mode:
bg-[#0f172a] that the agent wrote during the design session appear verbatim in the JSX output — they work natively in any Tailwind v4 project without additional configuration.
Inline mode in detail
Ininline mode every CSS property becomes a key in a style object. No Tailwind classes are emitted. This output is framework-agnostic and works in any React project:
Save the output as a .tsx file
The full export workflow — scoping to a component, choosing a mode, and writing the file — looks like this when you direct an agent to handle it end-to-end:1
Select the component in the canvas
Click the hero section in the canvas editor. Then ask the agent to call
get_selection:2
Call get_jsx with the component id
3
Write the .tsx file
The agent writes the The file is ready to import. If you’re using Tailwind v4 in your React project, the classes are identical to what was on the canvas — zero style translation needed.
jsx string from the response to a file in your React project:4
Import and use the component
Tips for cleaner exports
- Name your components in the canvas. Use the layers panel to rename elements before exporting. The agent uses the component structure from the canvas tree, so well-named layers produce more readable JSX.
- Group related elements before exporting. If you want a button and its label to export as a single component, make sure they share a parent wrapper in the canvas.
- Export incrementally. Export one section at a time using
componentIdscoping rather than exporting the entire canvas. Smaller components are easier to review and integrate. - Re-export after style changes. If you refine styles on the canvas after an initial export, run
get_jsxagain — the canvas is always the source of truth.
Next steps
Manage design tokens
Set up CSS custom properties on the canvas so exported components automatically reference your brand colors and spacing scale.
Design with an agent
Back to the full design workflow — adding components, iterating with screenshots, and refining styles.