A builder that creates API-compatible JSON data for text inputs.
Creates a new text input from API data.
Example
Creating a text input from an API data object:Example
Creating a text input using setters and API data:Name | Type | Optional | Description |
---|---|---|---|
data | Partial<APITextInputComponent> | Yes | The API data to create this text input with |
Clears the maximum length of text for this text input.
Clears the minimum length of text for this text input.
Clears the placeholder for this text input.
Clears the value for this text input.
Sets the custom id for this text input.
Name | Type | Optional | Description |
---|---|---|---|
customId | string | No | The custom id to use |
Sets the label for this text input.
Name | Type | Optional | Description |
---|---|---|---|
label | string | No | The label to use |
Sets the maximum length of text for this text input.
Name | Type | Optional | Description |
---|---|---|---|
maxLength | number | No | The maximum length of text for this text input |
Sets the minimum length of text for this text input.
Name | Type | Optional | Description |
---|---|---|---|
minLength | number | No | The minimum length of text for this text input |
Sets the placeholder for this text input.
Name | Type | Optional | Description |
---|---|---|---|
placeholder | string | No | The placeholder to use |
Sets whether this text input is required.
Name | Type | Optional | Description |
---|---|---|---|
required | boolean | Yes | Whether this text input is required |
Sets the style for this text input.
Name | Type | Optional | Description |
---|---|---|---|
style | TextInputStyle | No | The style to use |
Sets the value for this text input.
Name | Type | Optional | Description |
---|---|---|---|
value | string | No | The value to use |
Serializes this builder to API-compatible JSON data.Note that by disabling validation, there is no guarantee that the resulting object will be valid.
Name | Type | Optional | Description |
---|---|---|---|
validationOverride | boolean | Yes | Force validation to run/not run regardless of your global preference |