Option
Description
The Option component represents a single mutually exclusive choice inside a ChoiceGroup. In the public API, the helper method is Choice(...), and the underlying type is ChoiceGroup.Choice.
Use it when you need radio-button style selection where exactly one option should be active within a group.
Usage
Create options with Choice(...) and place them inside ChoiceGroup(...). The group manages shared selection state and exposes the selected option as an observable value.
API reference
public sealed class ChoiceGroup : ComponentBase<ChoiceGroup, HTMLDivElement>, IContainer<ChoiceGroup, ChoiceGroup.Choice>, IObservableComponent<ChoiceGroup.Choice>A group of radio-style choices of which exactly one may be selected at a time.
Constructors
Properties
public Choice SelectedOption { get ; private set ; }Gets or sets the selected option.
public string Label { get ; set ; }Gets or sets the label shown by the component.
public ChoiceGroupOrientation Orientation { get ; set ; }Gets or sets the orientation.
Methods
public override HTMLElement Render()Renders the component's root HTML element.
public void Replace(Choice newComponent, Choice oldComponent)Replaces an existing item with a new one.
public ChoiceGroup Choices(params ChoiceGroup.Choice[] children)Configures the component to choices.