Adds secondary text under each item using the Description name selector. The description is automatically linked to its input via aria-describedby, so screen readers announce it along with the item label.
+
+ Prevents changing the value while keeping the normal, non-disabled appearance. Unlike IsEnabled="false" the group stays fully reachable: Tab still lands on the checked item and the arrow keys still move the focus, so the choice can be read with the keyboard and a screen reader, and the value is still submitted with the form. The group reports aria-readonly, and every attempt to commit a change (a click, Space, or an arrow key) is cancelled, so the selection cannot move.
+
+
+
+ @bind-Value="readOnlyValue"
+ NameSelectors="@(new() { Text = { Name = nameof(Order.Name) }, Value = { Name = nameof(Order.ItemValue) } })" />
+
+
-
+ Customizes the gap between the items using any CSS length value, overriding the default spacing of the current size.
+
+
+
+ DefaultValue="@("A")"
+ NameSelectors="@(new() { Text = { Name = nameof(Order.Name) }, Value = { Name = nameof(Order.ItemValue) } })" />
-
+ DefaultValue="@("A")"
+ NameSelectors="@(new() { Text = { Name = nameof(Order.Name) }, Value = { Name = nameof(Order.ItemValue) } })" />
-
- ChoiceGroup with inline icon
+
+
+
+ Wraps the content of each item in plain text: the Prefix name selector maps a field that is rendered at the start of the item label, before the item text, and the Suffix name selector maps one that is rendered after the content of the item. Pairing Suffix with FullWidth and an auto inline start margin turns it into a trailing column, which is where a price or a hint usually belongs. For arbitrary content on either end, use the ItemPrefixTemplate and ItemSuffixTemplate shown in the Item templates section.
+
+
-
+
+ Raises OnChange with the new value whenever the selection actually changes, and OnClick with the whole item on every activation of an enabled item, including a click on the already selected one and an arrow key press, which the browser also reports as a click. OnFocus and OnBlur fire with the item as the focus moves between the items. All four stay silent while the group is disabled or read-only.
+
+
+
+
Changed value: @changedValue
+
Clicked custom: @clickedCustom
+
Focused custom: @focusedCustom
+
Blurred custom: @blurredCustom
-
- ChoiceGroup with icon
+
+
+
+ Handles dynamic item collections: assigning a new Items collection re-renders the group and re-assigns the index of each item (shown here as a number prefix), preserving the selected value as long as its item survives the change.
+
-
+
+ Add item
+ Remove item
+ Reverse items
+
+
+
+ @(custom.Idx + 1).
+
+
+
+
-
+
+ Adds a helper text under the label to explain the whole set of choices, as opposed to the per-item Description name selector that explains a single item. The group points its aria-describedby at it, so a screen reader announces it right after the name of the group. DescriptionTemplate replaces the plain text with custom content and takes precedence over Description when both are set.
+
+
+
-
+
+
+
+
+ Only the selected environment receives the new build.
+
+
+
+
+
+
+
+ Stretches the ChoiceGroup to the full width of its container instead of letting it hug its widest item, which is what lines a ChoiceGroup up with the other full width fields of a form. In the horizontal layout the items additionally share that width in equal columns. In the vertical layout every item row spans the full width, so LabelPosition.Start now has room to push the items to the far edge; stretching the item label over that row as well turns it into the label-at-the-start, circle-at-the-end list found in settings pages.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Sets the native browser tooltip of an item through the Title name selector, which is handy when the item text is an abbreviation or gets clipped. Keep it supplementary: a title never appears on keyboard focus and is announced inconsistently by screen readers, so anything every user has to read belongs in the item text, its AriaLabel, or its Description.
+
+
+
+
+
+
+
+ Moves the keyboard focus into the ChoiceGroup on its first render. It lands on the checked item, or on the first enabled item when nothing is checked, which is exactly the item the Tab key would reach, and it is skipped entirely while the group is disabled or read-only. The button below mounts a fresh ChoiceGroup so the focus move stays visible on demand instead of stealing the focus as soon as this page loads.
+
+
+ @(showAutoFocus ? "Unmount" : "Mount") the auto focused ChoiceGroup
+ @if (showAutoFocus)
+ {
+
+ }
-
- Offering a range of specialized color variants with Primary being the default, providing visual cues for specific actions or states within your application.
+
+ Colors the radio circle and the checked state of the items using the BitColor palette, with Primary being the default.
@@ -659,9 +806,8 @@
-
-
- Use icons from external libraries like FontAwesome or Bootstrap Icons with the Icon parameter and NameSelectors.
+
+ Renders icons from external libraries like Font Awesome or Bootstrap Icons using the Icon name selector, instead of the built-in icon font used by IconName.
@@ -694,8 +840,93 @@
-
- Explores styling and class customization for BitChoiceGroup, including component styles, custom classes, and detailed style items.
+
+ Comes in Small, Medium (default), and Large sizes that scale the radio circle, text, icons, and item spacing together.
+
+ Basic ChoiceGroup
+
+
+
+
+
+
+
+
+ ChoiceGroup with inline icon
+
+
+
+
+
+
+
+
+ ChoiceGroup with icon
+
+
+
+
+
+
+
+
+
+
+ Customizes the appearance at every level: Style and Class on the root element, per-item styles and classes, and the Styles and Classes objects that target the internal parts of the component, including the checked state of the items.
Component's Style & Class:
@@ -747,8 +978,8 @@