---
id: fast-element.viewtemplate
title: ViewTemplate class
hide_title: true
---
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[@microsoft/fast-element](./fast-element.md) &gt; [ViewTemplate](./fast-element.viewtemplate.md)

## ViewTemplate class

A template capable of creating HTMLView instances or rendering directly to DOM.

<b>Signature:</b>

```typescript
export declare class ViewTemplate<TSource = any, TParent = any> implements ElementViewTemplate, SyntheticViewTemplate 
```

## Constructors

|  Constructor | Modifiers | Description |
|  --- | --- | --- |
|  [(constructor)(html, directives)](./fast-element.viewtemplate._constructor_.md) |  | Creates an instance of ViewTemplate. |

## Properties

|  Property | Modifiers | Type | Description |
|  --- | --- | --- | --- |
|  [directives](./fast-element.viewtemplate.directives.md) |  | ReadonlyArray&lt;[HTMLDirective](./fast-element.htmldirective.md)<!-- -->&gt; | The directives that will be connected to placeholders in the html. |
|  [html](./fast-element.viewtemplate.html.md) |  | string \| HTMLTemplateElement | The html representing what this template will instantiate, including placeholders for directives. |

## Methods

|  Method | Modifiers | Description |
|  --- | --- | --- |
|  [create(hostBindingTarget)](./fast-element.viewtemplate.create.md) |  | Creates an HTMLView instance based on this template definition. |
|  [render(source, host, hostBindingTarget)](./fast-element.viewtemplate.render.md) |  | Creates an HTMLView from this template, binds it to the source, and then appends it to the host. |
