Skip to content

Component Radio

MeowLynxSea edited this page Jan 24, 2026 · 6 revisions

Radio

A single radio toggle.

Like Checkbox, Radio can be used as controlled or uncontrolled depending on whether you provide on_toggle.

Example

use yororen_ui::component::radio;

let view = radio().checked(true);

When to use

  • Standalone “on/off” toggles where the circle style is preferred
  • Building a custom radio group layout (otherwise use RadioGroup)

API

  • radio(): constructor
  • id(...) / key(...): stable identity
  • checked(bool)
  • disabled(bool)
  • tone(Hsla): override accent when checked
  • on_toggle(|checked, ev, window, cx| ...)

Defaults

  • Size: 18x18
  • Shape: circle
  • Accent when checked: tone(...) or theme.action.primary.bg

Notes

  • Standalone Radio toggles on/off when uncontrolled; for mutually-exclusive behavior, use RadioGroup.

Clone this wiki locally