Skip to content
Search
Search the documentation
Working with Modals
GitHub 7

Working with Modals

How to work with Modals in Honocord

Modals can be sent when the interaction is a modal-capable interaction - a slash or context command, or a message component interaction.

Sending a Modal

To send a modal, you can use the interaction.showModal() method. This method takes either a ModalBuilder instance or a raw ModalInteractionResponseCallbackData object.

Note

If you wanna send the new checkbox, checkbox-group and radio-group components, you **need** to use the raw object instead of the builder, as the builders from `@discordjs/builders` do not support these components yet. However receiving the data from these components works just fine.
			import { ModalBuilder, LabelBuilder, TextInputStyle } from "honocord";

const modal = new ModalBuilder()
  .setCustomId("my-modal")
  .setTitle("My Modal")
  .addLabelComponents(
    new LabelBuilder()
      .setLabel("Name")
      .setDescription("Enter your name")
      .setTextInputComponent((tiBuilder) => tiBuilder.setCustomId("name").setStyle(TextInputStyle.Short).setRequired(true))
  );

interaction.showModal(modal);
		
Edit this page Last updated: Nov 24, 2026