TextInput API Reference#

class miru.text_input.TextInput(*, label: str, style: ~hikari.components.TextInputStyle = <TextInputStyle.SHORT: 1>, 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)[source]#

Bases: ModalItem

A text input field that can be used in modals.

Parameters:
  • label (str) – The label above the text input field.

  • style (hikari.TextInputStyle, optional) – The style of the text input, by default hikari.TextInputStyle.SHORT

  • placeholder (Optional[str], optional) – Placeholder content in the text input, by default None

  • value (Optional[str], optional) – Pre-filled content of the input field, by default None

  • required (bool, optional) – If the text input is required for modal submission, by default False

  • min_length (Optional[int], optional) – The minimum required input length of the text input, by default None

  • max_length (Optional[int], optional) – The maximum allowed input length of the text input, by default None

  • custom_id (Optional[str], optional) – The custom identifier of the text input, by default None

  • row (Optional[int], optional) – The row of the text input, by default None

property label: str#

The text input’s label. This is the text visible above the text input.

property max_length: int | None#

What the maximum allowed length of the input text should be.

property min_length: int | None#

What the required minimum length of the input text should be.

property placeholder: str | None#

Placeholder content for this text input field.

property style: TextInputStyle#

The text input’s style.

property type: ComponentType#

The component’s underlying component type.

property 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.