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

[@microsoft/fast-element](./fast-element.md) &gt; [HTMLDirective](./fast-element.htmldirective.md)

## HTMLDirective class

Instructs the template engine to apply behavior to a node.

<b>Signature:</b>

```typescript
export declare abstract class HTMLDirective implements NodeBehaviorFactory 
```

## Properties

|  Property | Modifiers | Type | Description |
|  --- | --- | --- | --- |
|  [targetIndex](./fast-element.htmldirective.targetindex.md) |  | number | The index of the DOM node to which the created behavior will apply. |

## Methods

|  Method | Modifiers | Description |
|  --- | --- | --- |
|  [createBehavior(target)](./fast-element.htmldirective.createbehavior.md) |  | Creates a behavior for the provided target node. |
|  [createPlaceholder(index)](./fast-element.htmldirective.createplaceholder.md) |  | Creates a placeholder string based on the directive's index within the template. |
