Widgets

RadioGroup

RadioGroup

Group related radio choices into one selection.

Example

radio_group(
  value: "monthly",
  content: column(
    children: [
      radio(value: "monthly", label: "Monthly"),
      radio(value: "yearly", label: "Yearly")
    ]
  )
)

Common properties

  • value
  • content
  • on_change

Usage

radio_group(
  value: plan,
  on_change: ->(e) { plan = e.data },
  content: column(
    children: [
      radio(value: "basic", label: "Basic"),
      radio(value: "pro", label: "Pro")
    ]
  )
)

Notes

  • A radio_group typically wraps one layout control containing several radio(...) controls

Complete API

Helpers

  • radio_group(content = ..., **props)
  • radiogroup(content = ..., **props)

Accepted properties

  • badge — Badge drawn on the corner of the control.
  • col — Responsive column span (1-12) per breakpoint.
  • content — The single child control rendered inside this control.
  • data — Arbitrary value you can attach to the control and read back in handlers.
  • disabled — Disables interaction when true.
  • expand — Fills the available space along the parent's main axis when true.
  • expand_loose — Like expand, but only grows up to the child's natural size.
  • key — Stable identity used to preserve state across rebuilds.
  • opacity — Opacity from 0.0 (transparent) to 1.0 (opaque).
  • rtl — Renders right-to-left when true.
  • tooltip — Text shown on hover/long-press.
  • value — The control's current value.
  • visible — Hides the control when false.

Events

  • on_change — Fired when the value changes.

Wire reference

  • Family: materials
  • Widget type: radiogroup