Skip to content
Discussion options

You must be logged in to vote

You could style the RadioSet so that it is layout: grid. For example:

from textual.app import App, ComposeResult
from textual.containers import Horizontal
from textual.widgets import RadioButton, RadioSet


class RadioChoicesApp(App[None]):
    CSS = """
    Screen {
        align: center middle;
    }

    Horizontal {
        align: center middle;
        height: auto;
    }

    RadioSet {
        width: 45%;
        layout: grid;
        grid-size: 2;
    }
    """

    def compose(self) -> ComposeResult:
        with RadioSet(id="focus_me"):
            yield RadioButton("Battlestar Galactica")
            yield RadioButton("Dune 1984")
            yield RadioButton("Dune 2021")
    …

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@Apocryphon-X
Comment options

Answer selected by Apocryphon-X
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants