---
title: "Create a widget"
slug: "create-a-widget"
abstract: "How to configure results based on site and visitor contexts in Sitecore Search."
---
# Create a widget

The following procedures describe how to create widgets in Sitecore Search. New widgets have a *Default* variation that you can name when you create the widget. New widget variations do not have any rules.

In a multi-entity implementation, by default, widget variation rules are configured to apply when searching all entities. You can change the rule to apply to a single entity.

> [!note]
> If you want a widget to appear on a specific page, you must [add it to that page](https://doc.sitecore.com/search/en/users/search-user-guide/display-relevant-results/add-pages-and-widgets/create-a-landing-page.html "Create a landing page") before your developer can add it to your application.

## Search results widget

Use a search results widget to display full-page search results after a visitor has entered a keyphrase in the search box and run the search. If grouping is enabled, you can switch it off in the [widget settings](https://doc.sitecore.com/search/en/users/search-user-guide/display-relevant-results/add-pages-and-widgets/document-grouping.html#UUID-e776168d-de38-8124-1142-e3a39b61d703_section-idm234738624112731 "Edit grouping settings on a widget").

A search results widget is configured for you when your domain is created. However, if you need to create any additional search results widgets, you can use the following process to do so.

To create a search results widget:

1. On the menu bar, click **Widgets**.
2. On the **Widgets** tab, click **Add widget**.
3. Click **Search results**.
4. Enter or select values for the **Widget name**, **RFK ID**, **Variation name**, and **Will be used in** form fields, and then click **Next**.

    ![Setup widget screen with widget name, RFK ID, variation name, and will be used in fields.](https://doc.sitecore.com/api/markdown-image/search/en/users/search-user-guide/images/widget-options.png)

5. Review your choices. Then, to complete creating the widget, click **Save**.
6. To deploy your new widget, click **Publish**.

## Preview search widget

Use a preview search widget to create a pop-up search experience that gives visitors suggested content based on their search. This can include auto-completed and auto-corrected suggestions.

When your domain is created, a single preview search widget that is common across all pages is configured. However, if you want to use different [analyzers](https://doc.sitecore.com/search/en/users/search-user-guide/optimize-keyword-searches/types-of-analyzers.html "Types of analyzers") to provide different types of suggestions on different pages, you can create your own preview search widgets and [add them to specific pages](https://doc.sitecore.com/search/en/users/search-user-guide/display-relevant-results/add-pages-and-widgets/create-a-landing-page.html "Create a landing page").

To create a preview search widget:

1. On the menu bar, click **Widgets**.
2. On the **Widgets** tab, click **Add widget**.
3. Click **Preview search**.
4. Enter or select values for the **Widget name**, **RFK ID**, **Variation name**, and **Will be used in** form fields. Then, click **Next**.

    ![Setup widget screen with widget name, RFK ID, variation name, and will be used in fields.](https://doc.sitecore.com/api/markdown-image/search/en/users/search-user-guide/images/widget-options.png)

5. Review your choices. Then, to complete creating the widget, click **Save**.
6. To deploy your new widget, click **Publish**.

## Recommendation widget

Use a recommendation widget to display customized recommended content to visitors.

The most important part of the recommendation widget is the [recipe](https://doc.sitecore.com/search/en/users/search-user-guide/ai-driven-experiences/recipes-for-recommendations.html "Recipes for recommendations"), which determines the type of recommendations given.

For example, recommendation widgets can display content that is:

- Popular among visitors to your site.
- Recently viewed by the visitor.
- Similar to the content on the current page.

To create a recommendation widget:

1. On the menu bar, click **Widgets**.
2. On the **Widgets** tab, click **Add widget** > **Recommendation**.
3. On the **Setup Widget** screen, enter or select values for the **Widget name**, **RFK ID**, **Variation name**, and **Will be used in** fields, and then click **Next**.

    ![Setup widget screen with Widget name, RFK ID, Variation name, and Will be used in fields.](https://doc.sitecore.com/api/markdown-image/search/en/users/search-user-guide/images/widget-options.png)

4. To select a recipe to use with this widget, on the **Choose Recipes** screen, from the **Entities** drop-down menu, select an entity or *All*.
5. On the desired recipe card, click **Choose**.

    > [!important]
    > When selecting a recipe, make sure it is valid for the entity you intend to use it with. All entities supported by a particular recipe have a green checkmark next to them on the recipe card.

    To help you choose a recipe, you can filter recipes by:

    - *Name* - enter text in the **Search** input field.
    - *Creator* - select *Domain* or *Sitecore* in the drop-down menu.
6. To change a selected recipe, click **Choose another** or, to select another recipe for a different entity or entities, at the bottom of the screen, click ![plus_add__purple.png](https://doc.sitecore.com/api/markdown-image/search/en/users/search-user-guide/images/plus_add__purple.png)**Add**.
7. For each recipe added, to change the entity or entities you want to use that recipe for, select the check box beside the entity name.

    > [!tip]
    > An entity must have one recipe assigned for the widget to display recommendations for that entity.

8. When you have assigned all desired recipes, click **Next**.
9. Review your choices. To complete creating the widget, click **Save.** Then, to deploy your new widget, click **Publish**.