# Templates

The ListView enables you to define its content by utilizing the provided list item, header, footer, loader, and no-data templates.

## Item Template

To provide a template for each item that will be rendered in the ListView, nest an `<ng-template>`
tag with the [`kendoListViewItemTemplate`](https://www.telerik.com/kendo-angular-ui/components/listview/api/itemtemplatedirective) directive inside a `<kendo-listview>` tag.

The following values are available as context variables:

* `let-dataItem="dataItem"` (`any`)—The current data item. Also available as an implicit context variable.
* `let-index="index"` (`number`)—The current item index.
* `let-isFirst="isFirst"` (`boolean`)—Indicates whether the current data item will be rendered as the first item on the list.
* `let-isLast="isLast"` (`boolean`)—Indicates whether the current data item will be rendered as the last item on the list.

The following example demonstrates the [`kendoListViewItemTemplate`](https://www.telerik.com/kendo-angular-ui/components/listview/api/itemtemplatedirective) directive in action.

[Demo Source](https://demos.telerik.com/kendo-angular-ui/demos/listview/templates/list-item/source.txt)

## Header Template

To render a header section above the content container of the ListView, nest an `<ng-template>`
tag with the [`kendoListViewHeaderTemplate`](https://www.telerik.com/kendo-angular-ui/components/listview/api/headertemplatedirective) directive inside a `<kendo-listview>` tag.

The following example demonstrates how to add a filter input in the header of the ListView.

[Demo Source](https://demos.telerik.com/kendo-angular-ui/demos/listview/templates/header/source.txt)

## Footer Template

To render a footer section below the content container of the ListView, nest an `<ng-template>`
tag with the [`kendoListViewFooterTemplate`](https://www.telerik.com/kendo-angular-ui/components/listview/api/footertemplatedirective) directive inside a `<kendo-listview>` tag.

The following example demonstrates how to add a metadata section and a **Reload** data button in the footer of the ListView.

[Demo Source](https://demos.telerik.com/kendo-angular-ui/demos/listview/templates/footer/source.txt)

## Loader Template

When the [`loading`](https://www.telerik.com/kendo-angular-ui/components/listview/api/listviewcomponent#loading) property of the ListView is set to `true`, the ListView will display its built-in loading indicator ([see example](https://www.telerik.com/kendo-angular-ui/components/listview/paging#remote-binding)).

To render a custom loading indicator inside the content area of the ListView, nest an `<ng-template>`
tag with the [`kendoListViewLoaderTemplate`](https://www.telerik.com/kendo-angular-ui/components/listview/api/loadertemplatedirective) directive inside a `<kendo-listview>` tag.

The following example demonstrates how to integrate the [Kendo UI for Angular Loader component](https://www.telerik.com/kendo-angular-ui/components/indicators/loader) in the ListView.

[Demo Source](https://demos.telerik.com/kendo-angular-ui/demos/listview/templates/loader/source.txt)

## No-Data Template

When the ListView has no items to display—because the `data` input is an empty array or resolves to zero items after filtering—the content area remains empty unless you provide a no-data template.

To define what the ListView renders when there is no data, nest an `<ng-template>` tag with the [`kendoListViewNoDataTemplate`](https://www.telerik.com/kendo-angular-ui/components/listview/api/nodatatemplatedirective) directive inside the `<kendo-listview>` tag.

```html
<kendo-listview [data]="[]">
    <ng-template kendoListViewNoDataTemplate>
        No items to display.
    </ng-template>
</kendo-listview>
```

The following example demonstrates a custom no-data template with contextual messaging and inline action buttons. Use the category filters and the search box to narrow down the product list. When no items match, the template displays a relevant message and offers quick actions to clear the active filters.

[Demo Source](https://demos.telerik.com/kendo-angular-ui/demos/listview/templates/no-data/source.txt)

## Suggested Links

* [API Reference of the ListViewComponent](https://www.telerik.com/kendo-angular-ui/components/listview/api/listviewcomponent)
* [Paging](https://www.telerik.com/kendo-angular-ui/components/listview/paging)
* [Scroll Modes](https://www.telerik.com/kendo-angular-ui/components/listview/scroll-modes)
* [API Index of the ListView](https://www.telerik.com/kendo-angular-ui/components/listview/api)
