---
description: Generate data-{name}="value" HTML attribute
---

# HtmlData Attribute

```csharp
[Parameter][HtmlData("collapse")]public bool Active { get; set; }
[Parameter][HtmlData("toggle","active")]public bool Toggle { get; set; } 
```

```cshtml
<Component Active/>
<div data-collaspe="true"></div>

<Component Toggle/>
<div data-toggle="acitve"></div>
```
