Text Input API Reference#
TextInput
#
TextInput(
*,
label: str,
style: hikari.TextInputStyle = hikari.TextInputStyle.SHORT,
placeholder: str | None = None,
value: str | None = None,
required: bool = False,
min_length: int | None = None,
max_length: int | None = None,
custom_id: str | None = None,
row: int | None = None
)
Bases: ModalItem
A text input field that can be used in modals.
PARAMETER | DESCRIPTION |
---|---|
label |
The label above the text input field.
TYPE:
|
style |
The style of the text input
TYPE:
|
placeholder |
Placeholder content in the text input
TYPE:
|
value |
Pre-filled content of the input field
TYPE:
|
required |
If the text input is required for modal submission
TYPE:
|
min_length |
The minimum required input length of the text input
TYPE:
|
max_length |
The maximum allowed input length of the text input
TYPE:
|
custom_id |
The custom identifier of the text input
TYPE:
|
row |
The row of the text input
TYPE:
|
row
property
writable
#
row: int | None
The row the item should occupy. Leave as None for automatic placement.
position
property
writable
#
position: int | None
The position of the item within the row it occupies.
custom_id
property
writable
#
custom_id: str
The item's custom identifier. This will be used to track the item through interactions and is required for persistent views.
label
property
writable
#
label: str
The text input's label. This is the text visible above the text input.
placeholder
property
writable
#
placeholder: str | None
Placeholder content for this text input field.
value
property
writable
#
value: str | None
Pre-filled content that should be included in the text input. After sending the modal, this field will be updated to the user's input.