Skip to content

Radio

Radio buttons let people select a single option from two or more choices.

Example:

ft.RadioGroup(
    content=ft.Row(
        controls=[ft.Radio(label=f"{i}") for i in range(1, 4)],
        alignment=ft.MainAxisAlignment.CENTER,
    )
)

Radio

Simple radio buttons

Inherits: LayoutControl, AdaptiveControl

Properties

Events

Examples#

Live example

Basic Example#


basic

Handling selection changes#


handling-selection-changes

Styled radio buttons#


Properties#

active_color class-attribute instance-attribute #

active_color: ColorValue | None = None

The color used to fill this radio when it is selected.

autofocus class-attribute instance-attribute #

autofocus: bool = False

True if the control will be selected as the initial focus.

If there is more than one control on a page with autofocus set, then the first one added to the page will get focus.

fill_color class-attribute instance-attribute #

fill_color: ControlStateValue[ColorValue] | None = None

The color that fills the radio, in all or specific ControlState states.

focus_color class-attribute instance-attribute #

focus_color: ColorValue | None = None

The color of this radio when it has the input focus.

hover_color class-attribute instance-attribute #

hover_color: ColorValue | None = None

The color of this radio when it is hovered.

label class-attribute instance-attribute #

label: str = ''

The clickable label to display on the right of a Radio.

label_position class-attribute instance-attribute #

label_position: LabelPosition = RIGHT

Defaults to LabelPosition.RIGHT.

label_style class-attribute instance-attribute #

label_style: TextStyle | None = None

The label's style.

mouse_cursor class-attribute instance-attribute #

mouse_cursor: MouseCursor | None = None

The cursor for a mouse pointer entering or hovering over this control.

overlay_color class-attribute instance-attribute #

overlay_color: ControlStateValue[ColorValue] | None = None

The overlay color of this radio in all or specific ControlState states.

splash_radius class-attribute instance-attribute #

splash_radius: Number | None = None

The splash radius of the circular Material ink response.

toggleable class-attribute instance-attribute #

toggleable: bool = False

Set to True if this radio button is allowed to be returned to an indeterminate state by selecting it again when selected.

value class-attribute instance-attribute #

value: str | None = None

The value to set to containing RadioGroup when the radio is selected.

visual_density class-attribute instance-attribute #

visual_density: VisualDensity | None = None

Defines how compact the radio's layout will be.

Events#

on_blur class-attribute instance-attribute #

on_blur: ControlEventHandler[Radio] | None = None

Called when the control has lost focus.

on_focus class-attribute instance-attribute #

on_focus: ControlEventHandler[Radio] | None = None

Called when the control has received focus.