Skip to content

Add checkboxes, checkbox groups and radio groups#3010

Open
freya022 wants to merge 11 commits intodiscord-jda:masterfrom
freya022:feature/radio-groups-and-checkboxes
Open

Add checkboxes, checkbox groups and radio groups#3010
freya022 wants to merge 11 commits intodiscord-jda:masterfrom
freya022:feature/radio-groups-and-checkboxes

Conversation

@freya022
Copy link
Contributor

@freya022 freya022 commented Jan 21, 2026

Pull Request Etiquette

  • I have checked the PRs for upcoming features/bug fixes.
  • I have read the contributing guidelines.
  • I applied the code formatter to my changes with ./gradlew format

Changes

  • Internal code
  • Library interface (affecting end-user code)
  • Documentation
  • Other: _____

Closes Issue: NaN

Description

Add support for the new modal components.

These new components can allow your app to deliver a more polished UX for simple questions.

  • Checkbox is for a simple yes or no
  • RadioGroup allows the user to select one option out of multiple
  • CheckboxGroup allows the user to select multiple options.

They all must be placed within Label components.

Changelogs: https://docs.discord.com/developers/change-log#radio-groups%2C-checkbox-groups%2C-and-checkboxes-in-modals
Docs PR: discord/discord-api-docs#8123

Example

Modal.create("modal-id", "Modal")
        .addComponents(
                Label.of("I like checking boxes", Checkbox.of("checkbox-id", true)),

                Label.of("Which Discord client do you use?", RadioGroup.create("radiogroup-id")
                                .addOption("Discord (Stable)", "stable", "The vanilla option", true)
                                .addOption("Discord PTB", "ptb", "A peek into the future")
                                .addOption("Discord Canary", "canary", "Living on the edge")
                                .build()),

                Label.of("Which modal components do you use?", CheckboxGroup.create("checkboxgroup-id")
                                .addOption("Text Inputs", "textinputs")
                                .addOption("Select Menus", "selectmenus")
                                .addOption("File Uploads", "fileuploads")
                                .addOption("Checkbox groups", "checkboxgroups", null, true)
                                .build()
                )
        )
        .build();
image

@freya022 freya022 force-pushed the feature/radio-groups-and-checkboxes branch from ad4fb08 to dfa3370 Compare January 22, 2026 15:52
@freya022 freya022 marked this pull request as ready for review January 22, 2026 15:55
Added `getAsOptionalString` as an alternative
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants