Radio group
A group of radio buttons that lets the user select a single option from a list.
new RadioGroupComponent("radio-group")
Properties
| Property | Type | Default | Binding | Description |
|---|---|---|---|---|
| Own | ||||
OrientationSetOrientation · BindOrientation | UIOrientation? | UIOrientation.Vertical | one-way | The layout orientation of the radio buttons. |
SpacingSetSpacing · BindSpacing | UIResponsive<double>? | null | one-way | The gap between options; unset, the stylesheet's own gap for the orientation applies. |
| From InputTemplatedComponentBase | ||||
ValueSetValue · BindValue | string | null | two-way | The input's current value, boxed to Object; a concrete input also exposes its own typed Value alongside this one. |
IconColorSetIconColor · BindIconColor | UIThemeColor? | Primary | one-way | The leading icon's colour, defaulting to ITextBaseModel.DefaultIconColor. |
TitleTypeSetTitleType · BindTitleType | UITextAppearance? | Caption | one-way | The primary text type. |
BadgePlacementSetBadgePlacement · BindBadgePlacement | UITextBadgePlacement? | UITextBadgePlacement.Trailing | one-way | Where badge content is placed. |
IsReadOnlySetIsReadOnly · BindIsReadOnly | bool? | false | one-way | Whether the input can be seen but not edited; unlike IVisualComponent.Enabled, a read-only value still submits and stays focusable. |
FormIdSetFormId · BindFormId | string | null | one-way | The id of the form this input belongs to, used to scope Submit-trigger validation. |
ValidationSetValidation · BindValidation | UIValidationMessage? | null | one-way | A message the controller puts on the field, beside whatever the client rules say; the strongest one shows. |
ValidationPresentationSetValidationPresentation | UIValidationPresentation? | UIValidationPresentation.Auto | — | Where the message goes: a line under the field, or a mark at its edge with the message in a tooltip. Decided once at render; UIValidationPresentation.Auto is the line except in a cell of a grid. |
IconSetIcon · BindIcon | string | null | one-way | The icon shown before the title, by name from the registered icon font/set. translatable |
IconSizeSetIconSize · BindIconSize | UIIconSize? | null | one-way | The leading icon size; left unset the glyph is as tall as the title beside it. |
TitleSetTitle · BindTitle | string | null | one-way | The label text drawn as the title; nothing renders when it is unset. translatable |
TitleColorSetTitleColor · BindTitleColor | UIThemeColor? | Default | one-way | The primary text colour, which also colours the icon and the description unless either is overridden by ITextModel.DescriptionColor or IconColor. |
SelectableSetSelectable · BindSelectable | bool? | true | one-way | Whether the text can be selected with the pointer; content says yes, a control's caption says no. |
BadgeStyleSetBadgeStyle · BindBadgeStyle | UIBadgeType? | UIBadgeType.Info | one-way | The badge visual variant. |
BadgeColorSetBadgeColor · BindBadgeColor | UIThemeColor? | null | one-way | The badge's own colour, overriding IBadgeModel.BadgeStyle when set — a tag or a category swatch, which the closed style enum cannot name. |
BadgeIconSetBadgeIcon · BindBadgeIcon | string | null | one-way | The icon shown beside the badge text, by name from the registered icon font/set. translatable |
BadgeIconColorSetBadgeIconColor · BindBadgeIconColor | UIThemeColor? | Default | one-way | The badge icon's colour, defaulting to IBadgeModel.DefaultBadgeIconColor. |
BadgeIconSizeSetBadgeIconSize · BindBadgeIconSize | UIIconSize? | null | one-way | The badge icon size. Left unset the glyph is as tall as the badge's own text. |
BadgeTextSetBadgeText · BindBadgeText | string | null | one-way | The short text drawn inside the badge, beside its icon. translatable |
BadgeTextTypeSetBadgeTextType · BindBadgeTextType | UITextAppearance? | Overline | one-way | The badge text's role, defaulting to IBadgeModel.DefaultBadgeTextType. |
BadgeTooltipSetBadgeTooltip · BindBadgeTooltip | string | null | one-way | The tooltip for the badge content. translatable |
BadgeTooltipPlacementSetBadgeTooltipPlacement · BindBadgeTooltipPlacement | UIPopupPlacement? | UIPopupPlacement.Top | one-way | The side the badge's own tooltip prefers, placed against the badge rather than against the row. |
TooltipSetTooltip · BindTooltip | string | null | one-way | The tooltip shown on hover and on focus. On a button-shaped control with no title of its own — an icon button — it is also the name a screen reader gets. translatable |
TooltipPlacementSetTooltipPlacement · BindTooltipPlacement | UIPopupPlacement? | UIPopupPlacement.Top | one-way | The side the tooltip prefers; flips to the opposite side when there is no room for it there. |
| From ItemsComponentBase | ||||
ItemsSetItems · BindItems | IReadOnlyList<OptionItem> | null | one-way | The component items. |
ItemsViewBindItemsView | UIItemsView | null | one-way | Filtering and sorting rules applied to the items collection. |
QuerySetQuery · BindQuery | UIItemsQuery | null | two-way | The terms the viewer set after the view compiled — a header's sort, a filter row — applied beside the authored rules; bound both ways, so a windowed source is asked with them and a controller can set them. |
| From TemplatedComponentBase | ||||
TemplateKeyPropertySetTemplateKeyProperty · BindTemplateKeyProperty | string | null | one-way, relative scope | The name of the item field whose value selects a named template variant. |
FallbackTemplateKeySetFallbackTemplateKey | string | null | — | The fallback template key used when ITemplatedComponent.TemplateKeyProperty does not resolve to a template. |
Events
OnChange(string command)- Registers a change event command.
OnChange(string command, params KeyValuePair<string, UIActionArgument>[] arguments)- Registers a change event command with action arguments.
OnBlur(string command)- Registers a blur event command.
OnBlur(string command, params KeyValuePair<string, UIActionArgument>[] arguments)- Registers a blur event command with action arguments.
Methods
AddOption(OptionItem option)- Adds a single option to the list.
AddOptions(IEnumerable<OptionItem> options)- Adds multiple options to the list.
SetOptions(IEnumerable<OptionItem> options)- Replaces the list of options.
BindOptions(string path, UIBindingScope scope = UIBindingScope.Root, UIBindingMode mode = UIBindingMode.OneWay)- Binds the list of options to a property at the given string path.
BindOptions(RecursivePath path, UIBindingScope scope = UIBindingScope.Root, UIBindingMode mode = UIBindingMode.OneWay)- Binds the list of options to a property at the given recursive path.
ValidationInto(string componentId, UIProperty property)- Sends this field's validation message to another component's property, leaving the field its edge colour alone.
Required(string message, UIValidationTrigger trigger = UIValidationTrigger.Change, UIValidationSeverity severity = UIValidationSeverity.Error)- Adds a required-value validation rule.
Regex(string pattern, string message, UIValidationTrigger trigger = UIValidationTrigger.Change, UIValidationSeverity severity = UIValidationSeverity.Error)- Adds a regular-expression validation rule.
SetGroupTemplate(IVisualComponent template)- Sets the template used to render item groups.
SetTemplate(ITextComponent visualTemplate)- Sets the item template.
AddTemplateVariant(string key, ITextComponent visualTemplate)- Adds or replaces a named template variant.
AddItem(OptionItem item)- Adds an item to the component.
AddItems(IEnumerable<OptionItem> items)- Adds items to the component.
FilterBy(UIProperty source, string itemProperty, UIComparisonOperator operator = UIComparisonOperator.LikeIgnoreCase, UIComparisonOperator activeOperator = UIComparisonOperator.Required, object activeValue = null)- Adds a filter controlled by a local component property.
Defaults to a case-insensitive substring match; pass the operator explicitly where case matters. FilterBy(string sourceComponentId, UIProperty source, string itemProperty, UIComparisonOperator operator = UIComparisonOperator.LikeIgnoreCase, UIComparisonOperator activeOperator = UIComparisonOperator.Required, object activeValue = null)- Adds a filter controlled by another component property.
FilterBy(UIPropertyReference source, string itemProperty, UIComparisonOperator operator = UIComparisonOperator.LikeIgnoreCase, UIComparisonOperator activeOperator = UIComparisonOperator.Required, object activeValue = null)- Adds a filter controlled by a property reference.
FilterBy(string itemProperty, UIComparisonOperator operator = UIComparisonOperator.LikeIgnoreCase, object value = null)- Adds an unconditionally active filter with no source, comparing against a constant value.
SortBy(UIProperty source, string itemProperty, UIItemsSortDirection direction = UIItemsSortDirection.Ascending, UIComparisonOperator activeOperator = UIComparisonOperator.Equal, object activeValue = null, int priority = 0)- Adds a sort rule controlled by a local component property.
SortBy(string sourceComponentId, UIProperty source, string itemProperty, UIItemsSortDirection direction = UIItemsSortDirection.Ascending, UIComparisonOperator activeOperator = UIComparisonOperator.Equal, object activeValue = null, int priority = 0)- Adds a sort rule controlled by another component property.
SortBy(UIPropertyReference source, string itemProperty, UIItemsSortDirection direction = UIItemsSortDirection.Ascending, UIComparisonOperator activeOperator = UIComparisonOperator.Equal, object activeValue = null, int priority = 0)- Adds a sort rule controlled by a property reference.
SortBy(string itemProperty, UIItemsSortDirection direction = UIItemsSortDirection.Ascending, int priority = 0)- Adds an unconditionally active sort rule with no source.
SetEmptyTemplate(IVisualComponent visualTemplate)- Sets the template used when there are no items or no content.
Common properties (16) — layout, visibility, theme, and the rest every component shares
| Property | Type | Default | Binding | Description |
|---|---|---|---|---|
VisibilitySetVisibility · BindVisibility | UIResponsive<UIVisibility>? | Visible | one-way | What the component does with the room it was given, optionally overridden per breakpoint (e.g. collapsed from a given width up). |
EnabledSetEnabled · BindEnabled | bool? | true | one-way | Whether the component responds to input; false dims it and marks it, and its subtree, inert. |
ThemeSetTheme · BindTheme | UIThemeMode? | null | one-way | The theme mode forced on this component's subtree, or null to inherit the ambient theme. |
HorizontalAlignmentSetHorizontalAlignment · BindHorizontalAlignment | UIAlignment? | UIAlignment.Stretch | one-way | Where the component sits within its grid cell along the horizontal axis. |
VerticalAlignmentSetVerticalAlignment · BindVerticalAlignment | UIAlignment? | UIAlignment.Stretch | one-way | Where the component sits within its grid cell along the vertical axis. |
WidthSetWidth · BindWidth | UIResponsive<UILayoutLength>? | null | one-way | The component width, optionally overridden per breakpoint. |
MinWidthSetMinWidth · BindMinWidth | UIResponsive<UILayoutLength>? | null | one-way | The component minimum width, optionally overridden per breakpoint. |
MaxWidthSetMaxWidth · BindMaxWidth | UIResponsive<UILayoutLength>? | null | one-way | The component maximum width, optionally overridden per breakpoint. |
HeightSetHeight · BindHeight | UIResponsive<UILayoutLength>? | null | one-way | The component height, optionally overridden per breakpoint. |
MinHeightSetMinHeight · BindMinHeight | UIResponsive<UILayoutLength>? | null | one-way | The component minimum height, optionally overridden per breakpoint. |
MaxHeightSetMaxHeight · BindMaxHeight | UIResponsive<UILayoutLength>? | null | one-way | The component maximum height, optionally overridden per breakpoint. |
ZIndexSetZIndex · BindZIndex | int? | 0 | one-way | The stacking order within the visual tree. |
MarginSetMargin · BindMargin | UIResponsive<UIThickness>? | null | one-way | The outer spacing around the component, optionally overridden per breakpoint. |
PlacementSetPlacement · BindPlacement | UIResponsive<UIGridPlacement>? | null | one-way | The grid placement, optionally overridden per breakpoint. |
LoadingSetLoading · BindLoading | bool? | false | one-way | Whether the component is in loading state — a live state a controller turns on and off. |
ShowContextMenuSetShowContextMenu · BindShowContextMenu | bool? | true | one-way | Whether a right-click opens the IVisualComponent.ContextMenu; on a host with rows, whether it opens any row's. Off, the menu stays in the tree and nothing opens it. |