RadioGroup
A Fluent radio group: a set of options where only one can be selected.
Example:
fluent.RadioGroup(
value="medium",
items=[
fluent.RadioButton(value="small", label="Small"),
fluent.RadioButton(value="medium", label="Medium"),
fluent.RadioButton(value="large", label="Large"),
],
)

Inherits: LayoutControl
Example
Fluent RadioGroup
import flet_fluent_ui as fluent
import flet as ft
def main(page: ft.Page):
page.title = "Fluent RadioGroup"
def handle_change(e: ft.Event[fluent.RadioGroup]):
status.value = f"Size: {e.control.value}"
status = ft.Text("Size: medium")
page.add(
ft.SafeArea(
content=ft.Column(
controls=[
fluent.RadioGroup(
value="medium",
on_change=handle_change,
items=[
fluent.RadioButton(value="small", label="Small"),
fluent.RadioButton(value="medium", label="Medium"),
fluent.RadioButton(value="large", label="Large"),
],
),
status,
],
)
)
)
if __name__ == "__main__":
ft.run(main)

Properties
horizontalclass-attributeinstance-attribute
horizontal: bool = FalseWhether to lay out items in a row instead of a column.
itemsclass-attributeinstance-attribute
items: list[RadioButton] = field(default_factory=list)The options of this group.
Events
on_changeclass-attributeinstance-attribute
on_change: ControlEventHandler[RadioGroup] | None = NoneCalled when the selected option changes.
The data property of the event handler argument
contains the new value.