Radio
FormA styled radio button — circular with a primary dot when selected.
Preview
Usage
radio.rs
use floe_ui::components::radio;
"text-zinc-500">// Create radio buttons with shared selection state
let r1 = radio::styled_with("Option A", 0, Some(selected), Message::Selected(0), &tokens);
let r2 = radio::styled_with("Option B", 1, Some(selected), Message::Selected(1), &tokens);
let r3 = radio::styled_with("Option C", 2, Some(selected), Message::Selected(2), &tokens);API Reference
Props / Parameters
| Name | Type | Description |
|---|---|---|
| label | &str | Radio label text |
| value | V: Copy + Eq | Value this radio represents |
| selected | Option<V> | Currently selected value |
| on_click | Message | Message sent when clicked |
| tokens | &DesignTokens | Design tokens for theming |
Style Functions
default_style(tokens)
Style functions return closures compatible with Iced's .style() method.
Builder Functions
styled(label, value, selected, tokens)
styled_with(label, value, selected, on_click, tokens)
Builder functions return pre-configured Iced widgets ready for use.
Source: floe-ui/src/components/radio.rs