Form
            endstone.form
¶
    
            ActionForm
¶
ActionForm(
    title: str | Translatable = "",
    content: str | Translatable = "",
    buttons: list[Button] | None = None,
    on_submit: Callable[[Player, int], None] = None,
    on_close: Callable[[Player], None] = None,
)
Represents a form with buttons that let the player take action.
            on_submit
  
      property
      writable
  
¶
    Gets or sets the on submit callback.
            Button
¶
Button(
    text: str | Translatable = "",
    icon: str | None = None,
    on_click: Callable[[Player], None] = None,
)
Represents a button with text and an optional icon.
            add_button
¶
add_button(
    text: str | Translatable,
    icon: str | None = None,
    on_click: Callable[[Player], None] = None,
) -> ActionForm
Adds a button to the form.
            Dropdown
¶
Dropdown(
    label: str | Translatable = "",
    options: list[str] | None = None,
    default_index: int | None = None,
)
            MessageForm
¶
MessageForm(
    title: str | Translatable = "",
    content: str | Translatable = "",
    button1: str | Translatable = "",
    button2: str | Translatable = "",
    on_submit: Callable[[Player, int], None] = None,
    on_close: Callable[[Player], None] = None,
)
Represents a form with two buttons.
            on_submit
  
      property
      writable
  
¶
    Gets or sets the on submit callback.
            ModalForm
¶
ModalForm(
    title: str | Translatable = "",
    controls: (
        list[
            Dropdown
            | Label
            | Slider
            | StepSlider
            | TextInput
            | Toggle
        ]
        | None
    ) = None,
    submit_button: str | Translatable | None = None,
    icon: str | None = None,
    on_submit: Callable[[Player, str], None] = None,
    on_close: Callable[[Player], None] = None,
)
Represents a modal form with controls.
            controls
  
      property
      writable
  
¶
    Gets or sets the controls of the modal form.
            on_submit
  
      property
      writable
  
¶
    Gets or sets the on submit callback.
            submit_button
  
      property
      writable
  
¶
submit_button: str | Translatable | None
Gets or sets the submit button message of the form.
            Slider
¶
Slider(
    label: str | Translatable = "",
    min: float = 0,
    max: float = 100,
    step: float = 20,
    default_value: float | None = None,
)
            StepSlider
¶
StepSlider(
    label: str | Translatable = "",
    options: list[str] | None = None,
    default_index: int | None = None,
)
            TextInput
¶
TextInput(
    label: str | Translatable = "",
    placeholder: str | Translatable = "",
    default_value: str | None = None,
)
Represents a text input field.
            default_value
  
      property
      writable
  
¶
default_value: str | None
Gets or sets the optional default text of the text input field.
            placeholder
  
      property
      writable
  
¶
placeholder: str | Translatable
Gets or sets the placeholder of the text input field.
            Toggle
¶
Toggle(
    label: str | Translatable = "",
    default_value: bool = False,
)
Represents a toggle button with a label.