# AI Widget Builder > Generate Widgets from plain-language descriptions or ready-made templates with the AI builder. The AI Widget Builder creates a complete, working Widget from a description. Describe what you want in plain English, and the AI writes the code, schema, default values and the functions and states behind them. You don't need to write code. Describe your Widget, then refine it through the conversation. ## Getting Started Go to **Build › Widgets**, open the **Create Widgets** tab and click **Custom Widget**. The builder opens on the **AI Builder** tab. ![The Create Widgets tab under Build › Widgets with the Search templates box, the All types filter, the Upload Widget button and the Custom Widget button.](annotated/01-new-widget.webp "Custom Widget opens an empty builder.") You have two ways to start: * **Pick a template.** Under **What would you like to build?**, click **Pricing table**, **Order tracker**, **Product card** or **Contact form** to generate a Widget for that common use. * **Describe your own.** Type what you want in the **Describe a Widget...** box, for example "a contact form with name, email and message fields". ![The AI Builder tab of a new Widget with What would you like to build?, the Pricing table, Order tracker, Product card and Contact form templates, the Describe a Widget... box, and the preview with a Hello World placeholder.](annotated/02-starters.webp "Choose a template or describe your own.") Name the Widget by clicking its title at the top of the builder. ![The builder header with the Widget's name changed to Order status, next to the Create button.](annotated/03-name.webp "Click the title to name the Widget.") ![The Describe a Widget box holding a request for an order status card with an order number, a Shipped badge, an Ordered, Shipped and Delivered timeline, the items with image, quantity and price, and Track package and Contact support buttons with click tracking.](annotated/04-prompt.webp "Describe the Widget in plain language and send it.") > [!NOTE] > > Each generation uses 1 credit from your workspace. ## What the AI Generates When you send a description or pick a template, the AI builds the whole Widget: * **Code**: the full layout, ready to render. * **Schema**: the data fields the Widget expects and their types. * **Default**: sample values, so you see the Widget working straight away. * **Functions and states**: what each button and form does, and which parts show when. The AI's reply sums up what it built, and the preview on the right shows the result. ![The AI Builder after generation: the reply lists the order header, the delivery timeline, the items, the estimated delivery and the Track package and Contact support buttons, and the preview shows the order status card for QW-10482 with its Shipped badge, timeline and two items.](annotated/05-generated.webp "The AI's summary and the finished Widget in the preview.") > [!TIP] > > The AI Builder sets up the code, schema and default values together in one step. You don't need to configure them separately. ## Refining Your Widget After the first version, send follow-up messages in the **Ask for a change...** box. The builder works as a conversation, so you can keep refining. Examples of follow-up requests: * "Make the buttons blue" * "Add a phone number field" * "Change the heading to Welcome back" * "Remove the email check" Each follow-up updates the Widget's code, schema and default values together. Click **New conversation** (**+**) above the chat to start a fresh conversation about the same Widget. > [!WARNING] > > **Check functions that call your systems** > > The AI sets each function's type and settings for you, and states come with their conditions already filled in. But it can't know your real endpoints: > > * An API call or file upload you didn't give a URL for points to a placeholder address such as `https://api.example.com/endpoint`. Replace it with your own in the **Functions** tab. > * A link you didn't give an address for points to `https://example.com`. > > Always review the **Functions** and **States** tabs after generating or refining a Widget. ## Add Images to Your Widget You can upload images in the builder and use them in your Widget, such as logos, product photos and icons. In **Build › Widgets › AI Builder**, click the **Attach image** button in the message box. Choose how you'll use the image before you pick the file: * **Add image to Widget**: uploads and hosts the image, so the Widget can show it. * **Add design reference**: gives the image to the AI as a guide for the look, without adding it to the Widget. Use this to build a Widget from an existing design. * **Manage Widget images…**: see your hosted images, upload new ones, copy an image's URL, insert it into the code, or delete it. ![The image menu open above the Ask for a change box, with Add image to Widget, Add design reference and Manage Widget images….](annotated/06-attach.webp "Choose how the image is used before picking the file.") > [!NOTE] > > You decide whether an image goes into the Widget or serves as a design reference **before** you pick the file. Images are never hosted unless you choose **Add image to Widget**. Images in your messages are labeled **In Widget** or **Reference**, so you can tell hosted images from design references. You can also open **Widget images** from the **Code** tab's toolbar to upload and insert images without the AI Builder. See [Code Editor](/docs/developer-guides/widgets/code-editor#widget-images). ### Image limits * Up to **5 hosted images** per Widget. * Formats: **PNG, JPEG, WebP and GIF**. * Up to **5 MB** per image. * Up to **3 images** per message. The AI looks at the 4 most recent images in the conversation. > [!TIP] > > Hosted images stay with the Widget when you save it, close it and open it again. ## Undo If a result isn't what you wanted, go back to an earlier point in the conversation. Hover over one of your messages and click **Restore**. ![The pointer on the Restore button beside the first request in the AI Builder chat.](annotated/07-restore.webp "Restore appears beside each of your messages.") The builder asks you to confirm. Restoring puts the Widget back as it was at that message, and removes every later message and change. ![The Restore to this point? dialog, warning that later messages and changes will be permanently removed, with Cancel and Restore.](annotated/08-restore-dialog.webp "Confirm to roll the Widget back.") > [!NOTE] > > Restore can't be undone. Use it to return to the last good version before you try a different request. ## Live Preview The preview on the right shows the Widget as visitors will see it, and updates as soon as each generation finishes. Use the menu under the preview to switch between **Chat Bubble** and **Center Stage**, and the sun and moon buttons to check the light and dark themes. ## Saving Your Widget Click **Create** to save the Widget. The **Widget successfully created** dialog offers **Add to an Action**, so your agent can start showing it in conversations. ![The Widget successfully created dialog with the Add to an Action option and a Dismiss button.](annotated/09-create.webp "Attach the new Widget to an Action, or dismiss to keep editing.") ## Next steps > [card] Code Editor | /docs/developer-guides/widgets/code-editor | Edit the generated code, schema and examples. > [card] Functions | /docs/developer-guides/widgets/functions | Point each function at your own systems. > [card] States | /docs/developer-guides/widgets/states | Fine-tune when each part of the Widget shows.