# ASP.NET Core Sortable Overview

The Telerik UI Sortable TagHelper and HtmlHelper for ASP.NET Core are server-side wrappers for the Kendo UI Sortable widget.

The Sortable provides a sortable drag-and-drop functionality to elements within a list.

* [Demo page for the Sortable HtmlHelper](https://demos.telerik.com/aspnet-core/sortable/index)

* [Demo page for the Sortable TagHelper](https://demos.telerik.com/aspnet-core/sortable/tag-helper)

## Initializing the Sortable

Unlike most of the Telerik UI components, the Sortable does not render HTML markup. You have to initialize the Sortable for an existing DOM element.

The following example demonstrates a basic declaration of the Sortable. The component is initialized for the `sortable-basic` element making its list items sortable.

```Razor HtmlHelper
      <ul id="sortable-basic">
          <li class="sortable">Papercut <span>3:04</span></li>
          <li class="sortable">One Step Closer <span>2:35</span></li>
          <li class="sortable">With You <span>3:23</span></li>
      </ul>
      @(Html.Kendo().Sortable()
          .For("#sortable-basic") // The For() option of the Sortable is mandatory.
                                  // It accepts a jQuery selector that specifies
                                  // the already existing element for which the Sortable will be initialized.
          .HintHandler("hint") // The JavaScript function that returns the hint element of the Sortable.
          .PlaceholderHandler("placeholder") // The JavaScript function that constructs the placeholder element of the Sortable.
      )
      <script>
          // Define the hint handler.
          function hint(element) {
              return element.clone().addClass("hint");
          }
          // Define the placeholder handler.
          function placeholder(element) {
              return element.clone().addClass("placeholder").text("drop here");
          }
      </script>
```

```Razor TagHelper
    <ul id="sortable-basic">
          <li class="sortable">Papercut <span>3:04</span></li>
          <li class="sortable">One Step Closer <span>2:35</span></li>
          <li class="sortable">With You <span>3:23</span></li>
    </ul>
    <kendo-sortable name="sortable-basic" hint="hint" placeholder="placeholder">
    </kendo-sortable>
    <script>
          // Define the hint handler.
          function hint(element) {
              return element.clone().addClass("hint");
          }
          // Define the placeholder handler.
          function placeholder(element) {
              return element.clone().addClass("placeholder").text("drop here");
          }
    </script>
```

## Functionality and Features

| Feature                                                                                                                                                   | Description                                                                                  |
| --------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- |
| [Hint](https://www.telerik.com/aspnet-core-ui/documentation/html-helpers/interactivity/sortable/hint)                                                     | Set the Sortable item hint.                                                                  |
| [Items](https://www.telerik.com/aspnet-core-ui/documentation/html-helpers/interactivity/sortable/items)                                                   | Control the behavior of the Sortable items.                                                  |
| [Cursor](https://www.telerik.com/aspnet-core-ui/documentation/html-helpers/interactivity/sortable/cursor)                                                 | Configure the cursor type displayed when dragging a sortable item.                           |
| [Placeholder](https://www.telerik.com/aspnet-core-ui/documentation/html-helpers/interactivity/sortable/placeholder)                                       | Customize the default Sortable placeholder.                                                  |
| [Integration with other Telerik UI components](https://www.telerik.com/aspnet-core-ui/documentation/html-helpers/interactivity/sortable/integration/grid) | Use the Sortable with other Telerik UI components to reoder their items.                     |
| [Events](https://www.telerik.com/aspnet-core-ui/documentation/html-helpers/interactivity/sortable/events)                                                 | The Sortable allows you to handle its events and implement the desired custom functionality. |
| [Accessibility](https://www.telerik.com/aspnet-core-ui/documentation/html-helpers/interactivity/sortable/accessibility/overview)                          | The component is accessible for screen readers and supports WAI-ARIA attributes.             |

## Next Steps

* [Getting Started with the Sortable](https://www.telerik.com/aspnet-core-ui/documentation/html-helpers/interactivity/sortable/getting-started)

* [Basic Usage of the Sortable HtmlHelper for ASP.NET Core (Demo)](https://demos.telerik.com/aspnet-core/sortable)

* [Basic Usage of the Sortable TagHelper for ASP.NET Core (Demo)](https://demos.telerik.com/aspnet-core/sortable/tag-helper)

## See Also

* [Common Scenarios with the Sortable](https://www.telerik.com/aspnet-core-ui/documentation/html-helpers/interactivity/sortable/common-scenarios)
* [Configure the Filtered and Disabled Items of the Sortable for ASP.NET Core (Demo)](https://demos.telerik.com/aspnet-core/sortable/filter-disable)
* [Knowledge Base Section](https://www.telerik.com/aspnet-core-ui/documentation/knowledge-base)
