Reflex Cloud - Fast, secure & scalable hosting. One command to deploy.

Radio Group

A set of interactive radio buttons where only one can be selected at a time.

Basic example

No Selection

Submitting a form using Radio Group

The name prop is used to name the group. It is submitted with its owning form as part of a name/value pair.

When the required prop is True, it indicates that the user must check a radio item before the owning form can be submitted.

Example Form

Results:

{}

API Reference

rx.radio_group

High level wrapper for the RadioGroup component.

PropType | ValuesDefaultInteractive
items
List
direction
"row" | "column" | ...
LiteralVar.create("row")
spacing
"0" | "1" | ...
LiteralVar.create("2")
size
"1" | "2" | ...
LiteralVar.create("2")
variant
"classic" | "surface" | ...
LiteralVar.create("classic")
color_scheme
"tomato" | "red" | ...
high_contrast
bool
value
str
default_value
str
disabled
bool
name
str
required
bool

rx.radio_group.root

A set of interactive radio buttons where only one can be selected at a time.

PropType | ValuesDefaultInteractive
size
"1" | "2" | ...
LiteralVar.create("2")
variant
"classic" | "surface" | ...
LiteralVar.create("classic")
color_scheme
"tomato" | "red" | ...
high_contrast
bool
value
str
default_value
str
disabled
bool
name
str
required
bool

Event Triggers

See the full list of default event triggers
TriggerDescription
on_change Props to rename Fired when the value of the radio group changes.

rx.radio_group.item

An item in the group that can be checked.

PropType | ValuesDefaultInteractive
value
str
disabled
bool
required
bool