express.ui.input_radio_buttons(id, label, choices, *, selected=None, inline=False, width=None)

Create a set of radio buttons used to select an item from a list.


id: str

An input id.

label: TagChild

An input label.

choices: ChoicesArg

Either a list of choices or a dictionary mapping choice values to labels. Note that if a dictionary is provided, the keys are used as the (input) values so that the dictionary values can hold HTML labels.

selected: Optional[str] = None

The values that should be initially selected, if any.

inline: bool = False

If True, the result is displayed inline.

width: Optional[str] = None

The CSS width, e.g. ‘400px’, or ‘100%’.


Type Description
Tag A UI element


Server value

A string with the selected value.

See Also


#| standalone: true
#| components: [editor, viewer]
#| layout: vertical
#| viewerHeight: 400

## file:
from import input, render, ui

    "Choose one:",
        "html": ui.HTML("<span style='color:red;'>Red Text</span>"),
        "text": "Normal text",
def val():
    "You chose " + input.rb()