A user input component that allows users to choose a single value from a list of options using radio buttons.

Fields

NameTypeDescriptionOptions
LabelText--
OptionsKey-ValueKey-value object with options. Must be a JSON string or a state reference to a dictionary.-
OrientationTextSpecify how to lay out the options.
  1. Vertical
  2. Horizontal
Primary textColor--
AccentColor--
Custom CSS classesTextCSS classes, separated by spaces. You can define classes in custom stylesheets.-

Events

Sent when the selected option changes.
def onchange_handler(state, payload):

# Set the state variable "selected" to the selected radio option

state["selected"] = payload