# Client components

Sitefinity CMS provides an assortment of built-in, reusable client components you can use on widget designers' frontend. Client components allow flexible widget designer implementation that reflect various requirements of the UI of widget designers, for example, having a search box or a date and time picker.

The following types of client components are available out-of-the-box:

<table>
<colgroup><col><col></colgroup>
<tbody>
<tr>
<td>

<strong>Component</strong>

</td>
<td>

<strong>Description</strong>

</td>
</tr>
<tr>
<td>

Selectors

</td>
<td>

Components that allow single and multiple selection of content items.\
Examples: *Page* selector, *Event* selector, *News* selector, and so on.\
For more information, see [Selectors](https://www.progress.com/documentation/sitefinity-cms/selectors-mvc).

</td>
</tr>
<tr>
<td>

Fields

</td>
<td>

Examples: *HTML* field (rich text), *Media* field (combines selectors). *Media* field is used for images, videos and documents. In addition, the *Image* field provides more frontend functionality on top of the *Media* field.\
For more information, see [Fields](https://www.progress.com/documentation/sitefinity-cms/fields-mvc).

</td>
</tr>
<tr>
<td>

Custom components

</td>
<td>

Built-in components that provide additional frontend functionality for widget designers.\
Examples: *Code area*, *Infinite scroll*, *Tree view*, and others.\
For more information, see [Custom components](https://www.progress.com/documentation/sitefinity-cms/custom-components-mvc).

</td>
</tr>
</tbody>
</table>

You use client components in the widget designer views either as an HTML element attribute, or as an HTML element. However, just adding components in the view is not enough. You also need to specify the dependency in the widget designer JSON `config` file, as well as in the widget controller.

The following example demonstrates how to use the *Event* selector in the *Simple* view of a widget designer. You have the following widget designer files:

* `DesignerView.Simple.cshtml` - represents the designer view, located in the `Views` folder
* `DesignerView.Simple.json` - represents the designer configuration, located in the `Views` folder
* `designerview-simple.js` - represents the designer controller, located in the `Scripts` folder

To use the *Event* selector, you need to have the following code in the respective files, listed above:

**DesignerView\.Simple.cshtml**:

```HTML
<sf-list-selector 
  sf-event-selector 
  sf-selected-item-id="properties.SelectedItemId.PropertyValue">
</sf-list-selector>
```

**DesignerView\.Simple.json**:

```JSON
{
  "priority": 1,
  "components": [ "sf-list-selector", "sf-event-selector" ],
  "scripts": []
}
```

**designerview-simple.js**:

```JavaScript
(function () {
    // The 'sfSelectors' module needs to be pushed into the 'designer' module.
    // The 'designer' module is the module that is responsible for the current widget designer.
    angular.module('designer').requires.push('sfSelectors');

    angular.module('designer')
        .controller('SimpleCtrl', ['$scope', 'propertyService', function ($scope, propertyService) {
            propertyService.get()
                .then(function (data) {
                    if (data) {
                        // Get all widget controller properties
                        $scope.properties = propertyService.toAssociativeArray(data.Items);
                    }
                });
        }]);
}());
```
