Radio Group

As defined by the W3C:

A radio group is a set of checkable buttons, known as radio buttons, where no more than one of the buttons can be checked at a time. Some implementations may initialize the set with all buttons in the unchecked state in order to force the user to check one of the buttons before moving past a certain point in the workflow.

While any DOM content is permissible as a child of the radiogroup, only <FluentRadio>'s and slotted content with a role of radio will receive keyboard support.

<FluentRadioGroup> wraps the <fluent-radio-group> element, a web component implementation of a radio group leveraging the Fluent UI design system.

Examples

Default

Example
One Two

Selected: ()

One Two

Selected: ()

Download: 

In a toolbar

Example
Go back forward refresh Stop
Download: 

States

Example

Read only

Word Excel

Disabled

Lamborghini Ferari
Download: 

Label outside group

Example

With label outside group

Apples Oranges Bananas Kiwi Grapefruit Mango Blueberries Strawberries Pineapple

Your favorite fruit: apples!

Download: 

With preset

Example

Preset value

Ice Man Maverick Viper Jester

The best pilot according to you is: maverick!

Your favorite pilot: maverick!

Download: 

Documentation

FluentRadioGroup<TValue> Class

Inherits from FluentInputBase<TValue>.
There might be parameters and/or methods shown here that are inherited from the component's base type but are not applicable to this component.

Note: Although the component is generic, it only supports simple types like int, string and bool.

Parameters

Name
Type
Default
Description
AriaLabelstring?
Gets or sets the text used on aria-label attribute.
Autofocusbool
False
Determines if the element should receive document focus on page load.
ChildContentRenderFragment?
Gets or sets the child content to be rendering inside the FluentRadioGroup.
Disabledbool
False
Disables the form control, ensuring it doesn't participate in form submission.
DisplayNamestring?
Gets or sets the display name for this field.
This value is used when generating error messages when the input value fails to parse correctly.
Embeddedbool
False
Gets or sets if the derived component is embedded in another component.
If true, the ClassValue property will not include the EditContext's FieldCssClass.
FieldFieldIdentifier?
Gets or sets the FluentInputBase.FieldIdentifier that identifies the bound value.
If set, this parameter takes precedence over FluentInputBase.ValueExpression.
Immediatebool
False
Change the content of this input field when the user write text (based on 'OnInput' HTML event).
ImmediateDelayint
0
Gets or sets the delay, in milliseconds, before to raise the FluentInputBase.ValueChanged event.
Labelstring?
Gets or sets the text to label the input.
This is usually displayed just above the input
LabelTemplateRenderFragment?
Gets or sets the content to label the input component.
This is usually displayed just above the input
Namestring?
Gets or sets the name of the element.
Allows access by name from the associated form.
⚠️ This value needs to be set manually for SSR scenarios to work correctly.
OrientationOrientation?
Gets or sets the orientation of the group. See Orientation
Placeholderstring?
Gets or sets the short hint displayed in the input before the user enters a value.
ReadOnlybool
False
When true, the control will be immutable by user interaction. readonly HTML attribute for more information.
Requiredbool
False
Gets or sets a value indicating whether the element needs to have a value.
ValueTValue?
Gets or sets the value of the input. This should be used with two-way binding.
ValueExpressionExpression<Func<TValue>>?
Gets or sets an expression that identifies the bound value.

EventCallbacks

Name
Type
Description
ValueChangedEventCallback<TValue>
Gets or sets a callback that updates the bound value.

Methods

Name
Parameters
Type
Description
FocusAsyncvoid
Exposes the elements FocusAsync(bool preventScroll) method.
FocusAsyncbool preventScroll
void
Exposes the elements FocusAsync(bool preventScroll) method.
Horizontal
Vertical
An error has occurred. This application may no longer respond until reloaded. Reload 🗙