top of page

Studio, Partners & Enterprise

Wix Studio

Studio Editor: Using the AI Assistant to Add Custom Code


Currently, this feature is in alpha mode.


Add custom code behaviors to elements, without any coding experience, using our AI assistant. Whether you're enhancing interactivity or creating tailored experiences, AI makes it simple. Focus on your creative vision while the assistant handles the technical coding, offering suggestions or implementing your own ideas.


There are 2 ways you can access the AI assistant for help with custom code – directly through the Code panel, or by selecting an element on the canvas. .

On the canvas: Right-click the element you want to customize and select Add Custom Behavior with AI.

Right-clicking a text element on the canvas in the Studio Editor and selecting the option to add custom behavior with AI

Through the Code panel: Access the Code

Studio Editor: Using the AI Assistant to Add Custom Code

panel on the left side of the editor and select AI Assistant.

The AI Assistant tab in the Code panel in the Studio Editor, showing a new conversation

excerpt from a conversation with the AI assistant after it generated custom code, disabling a button for visitors in germany


Adding custom behavior with AI


Access the AI assistant from the Code panel, or right-click the specific element you want to customize. The assistant will send an initial message on your behalf – ‘What interactive behavior can you apply to (element ID)?’— and offer tailored suggestions based on the element.


Pick a suggested behavior or describe the customization you have in mind. You’ll always have the chance to preview and approve the code before it’s added to your client’s site.


To add custom behavior with AI:


  1. Go to your editor.

  2. Right-click the relevant element.

  3. Select Add Custom Behavior with AI.

    Tip: This opens the chat with the AI assistant (within the Code panel) on the left side of the editor.

  4. Review the AI assistant's suggestions for custom behaviors it can add.

  5. Describe what you want to customize and click the Send icon

    Studio Editor: Using the AI Assistant to Add Custom Code

    .

    Tip: It doesn't have to be one of the suggestions if you had a different idea in mind. The AI assistant will evaluate and advise if it can add the customization you're thinking of.

  6. Choose what to do next:

    • Refine the customization: Continue chatting to the AI assistant to clarify the specific customization you want it to add.

    • Preview the code: Click Show code to see the code AI intends to add. It also provides a breakdown of what the code does, clarifying how it applies the customization.

    • Add the code: Add the code to your client's site.

      1. Click Add code.

      2. Click Approve to confirm adding the code.


What's next?


  • Click Preview under Generated Code to see how your customization looks.

  • You can always click the New Chat icon

    Studio Editor: Using the AI Assistant to Add Custom Code

    to start a conversation about another customization you want AI to make.


Conversation with the AI assistant, showing the end where it generated code that disables a button for visitors from germany


Reverting code changes done by AI


Restore your client's site to its previous state if you want to undo changes made by the AI assistant. You can access your chat history with the assistant and revert any generated code back to an earlier version.


To restore the code to the previous state:


  1. Go to your editor.

  2. Click Code

    undefined

    on the left side of the editor.

  3. Click AI Assistant.

  4. Click the More Actions icon

    Studio Editor: Using the AI Assistant to Add Custom Code

    at the top right of the code panel.

  5. Select Show chat history.


the AI assistant in the code panel, cursor clicking the more actions icon and selecting the 'show chat history' option

  1. Select the relevant conversation.

  2. Click Restore under the relevant Generated Code section.


Part of a previous chat with the AI assistant, showing the generated code section and the restore button


FAQs


Click a question below to learn more.


While the AI assistant can perform many actions on various elements, Wix apps and other third-party apps have certain limitations.

If the assistant is unable to help with a certain action, it will let you know and suggest some alternative actions as well.

Studio Editor: Using the AI Assistant to Add Custom Code

When chatting to the AI assistant, it may give you suggestions for elements on the page it can customize. Each element has a unique ID identifying it in the code.

a message from the AI assistant asking what element to customize, and a list of element IDs on the page

When dev mode is enabled, you can see element IDs when selecting the relevant element on the canvas, or in the Layers panel.

On the canvas: When selecting an element, the element ID appears on the blue label, right next to the element name. In the example below, the text element's ID is 'text7'.

Studio Editor: Using the AI Assistant to Add Custom Code

In the Layers panel: Open this panel to get an overview of all of the elements on the page and their IDs. Make sure the Display IDs toggle is enabled.

Studio Editor: Using the AI Assistant to Add Custom Code

Need An AI Run Website?
Contact Us
 Today!

wix experts
Graphic2Traffic web design
©
bottom of page