Create Playground GitHub crates.io npm

Radio Group

Single-select group, vertical or horizontal, arrow-key nav.

ui form

Preview

Installation

cargo slintcn add radio-group

Usage

import { RadioGroup, RadioOrientation } from "slintcn/components/radio-group.slint";

RadioGroup {
    items: [{ label: "Free" }, { label: "Pro" }, { label: "Team" }];
    selected <=> tier;
    changed(i) => { /* … */ }
}

Properties

label in string

Label text rendered next to this RadioItem.

active in bool

Whether this RadioItem is selected.

show-focus in bool

When true, the focus ring renders even without keyboard focus.

disabled in bool

When true, this control dims and stops responding.

clicked callback ()

Fired when this RadioItem is activated.

pointer-down callback ()

Fired on left-button pointer-down (used by RadioGroup to set pointer-focus).

items in [RadioItem]

Options shown in the group.

selected in-out int

Two-way; index of the chosen item.

disabled in bool

When true, this control dims and stops responding.

orientation in RadioOrientation

`vertical` (default) or `horizontal`.

changed callback (int)

Fired with the new `selected` index.

API

RadioOrientationverticalhorizontal
Accessibility
focusableyes
keyboardArrow keysSpace

Dependencies

focus-ring

Installed automatically as transitive dependencies of slintcn add radio-group.