Skip to content

Conversation

@shiftinv
Copy link
Member

Summary

Note

This is in private testing at the moment, and will be made available to everyone within the next couple weeks.

This adds RadioGroup (single-select) and CheckboxGroup (multi-select) components, as well as a simple Checkbox component, for use in modals only.

Example
await inter.response.send_modal(
    title="waow, checkboxes",
    custom_id=str(inter.id),
    components=[
        ui.Label(
            "Select all squares with traffic lights",
            ui.CheckboxGroup(
                [
                    "What",
                    "This doesn't make any sense",
                    "🚦",
                ],
            ),
        ),
        ui.Label(
            "Select your favorite flavor of ice cream:",
            ui.RadioGroup(
                [
                    "Vanilla",
                    "Chocolate",
                    disnake.GroupOption(label="Wasabi", description="please don't"),
                    disnake.GroupOption(label="all of the above", description="if you're indecisive"),
                ],
                required=False,
            ),
        ),
        ui.Label(
            "I've read the terms and conditions (promise?)",
            ui.Checkbox(),
        ),
    ],
)
image

Checklist

  • If code changes were made, then they have been tested
    • I have updated the documentation to reflect the changes
    • I have formatted the code properly by running uv run nox -s lint
    • I have type-checked the code by running uv run nox -s pyright
  • This PR fixes an issue
  • This PR adds something new (e.g. new method or parameters)
  • This PR is a breaking change (e.g. methods or parameters removed/renamed)
  • This PR is not a code change (e.g. documentation, README, ...)

@shiftinv shiftinv added this to the disnake v2.12 milestone Jan 21, 2026
@shiftinv shiftinv added this to disnake Jan 21, 2026
@shiftinv shiftinv added t: enhancement New feature t: api support Support of Discord API features s: needs review Issue/PR is awaiting reviews labels Jan 21, 2026
@github-project-automation github-project-automation bot moved this to Todo in disnake Jan 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

s: needs review Issue/PR is awaiting reviews t: api support Support of Discord API features t: enhancement New feature

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

1 participant