Newer
Older
description: The HTML class defines a HTML instance for the Tripetto builder.
---
import Preview from '@site/src/components/preview.js';
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
## 📖 Description {#description}
The `HTML` class defines a HTML instance for the Tripetto builder. It is derived from the [`Control`](Control.mdx) class.
## 📺 Preview {#preview}
<Preview src="forms-html.png" />
---
## 🆕 `constructor` {#constructor}
Creates a new `HTML` instance.
#### Signature
```ts
constructor(htmlCode: string, interactive?: boolean, style?: IHTMLStyle): HTML
```
#### Parameters
| Name | Type | Optional | Description |
|:--------------|:----------------------------|:---------|:----------------------------------------------------------------------------------------------------------------------------------------------|
| `htmlCode` | string | No | Specifies the HTML code for the control. |
| `interactive` | boolean | Yes | Specifies if the HTML code is interactive. Tripetto's touch controller is disabled in that case so events can propagate to the HTML elements. |
| `style` | [`IHTMLStyle`](#IHTMLStyle) | Yes | Specifies the HTML style (when omitted the default global style will be used). |
#### Return value
Returns a reference to the new `HTML` instance.
## 📌 Statics {#statics}
---
### 🏷️ `style` {#statics-style}
Contains the global default style for the HTML control.
#### Type
[`IHTMLStyle`](#IHTMLStyle)
## 🗃️ Fields {#fields}
---
### 🏷️ `HTML` {#HTML}
Sets or retrieves the HTML code.
#### Type
string
---
### 🏷️ `isVisible` {#isVisible}
Sets or retrieves the visibility of the control.
#### Type
boolean
---
### 🏷️ `style` {#style}
Contains the style for the HTML control.
#### Type
[`IHTMLStyle`](#IHTMLStyle)
## ▶️ Methods {#methods}
---
### 🔧 `hide` {#hide}
Hides the control.
#### Signature
```ts
hide(): this
```
#### Return value
Returns a reference to the `HTML` instance to allow chaining.
---
### 🔧 `indent` {#indent}
Enables control indentation. This can only be set during construction.
#### Signature
```ts
indent(size: number): this
```
#### Parameters
| Name | Type | Optional | Description |
|:-------|:-------|:---------|:-------------------------------------|
| `size` | number | No | Specifies the indent size in pixels. |
#### Return value
Returns a reference to the `HTML` instance to allow chaining.
---
### 🔧 `show` {#show}
Shows the control.
#### Signature
```ts
show(): this
```
#### Return value
Returns a reference to the `HTML` instance to allow chaining.
---
### 🔧 `update` {#update}
Indicates to the control something has changed in the HTML hosted by the control and the control needs to update its dimensions.
#### Signature
```ts
update(): void
```
---
### 🔧 `visible` {#visible}
Specifies the visibility of the control.
#### Signature
```ts
visible(visible?: boolean): this
```
#### Parameters
| Name | Type | Optional | Description |
|:----------|:--------|:---------|:---------------------------------------------------------|
| `visible` | boolean | Yes | Specifies if the control is visible (default is `true`). |
#### Return value
Returns a reference to the `HTML` instance to allow chaining.
## ⛓️ Interfaces {#interfaces}
---
### 🔗 `IHTMLStyle` {#IHTMLStyle}
Describes the interface for the HTML styles.
#### Type declaration
```ts
interface IHTMLStyle {
/* HTML appearance. */
appearance?: IStyles;
/* HTML appearance when fused with form. */
fused?: IStyles;
}
```