Radio
Radio
When To Use
-Used to select a single state from multiple options. -The difference from Select is that Radio is visible to the user and can facilitate the comparison of choice, which means there shouldn't be too many of them.
Examples
Radio API#
Property | Description | Type | Default Value |
---|---|---|---|
ChildContent | ParameterDisplay label content for the radio | RenderFragment | -- |
Value | ParameterSelected value | TValue | -- |
AutoFocus | ParameterAutofocus or not | Boolean | false |
RadioButton | ParameterSet to true to style the radio as button group. |
Boolean | false |
Checked | ParameterSpecifies whether the radio is selected | Boolean | -- |
DefaultChecked | ParameterSpecify if the radio button is checked initially or not | Boolean | false |
CheckedChanged | ParameterCallback executed when the checked state changes | EventCallback<Boolean> | -- |
Disabled | ParameterDisable the radio buton | Boolean | -- |
CheckedChange | ParameterCallback executed when the checked state changesUse CheckedChanged instead Obsolete Will be removed in a future version. |
EventCallback<Boolean> | -- |
Id | ParameterID for the component's HTML | String | Uniquely Generated ID |
Class | ParameterSpecifies one or more class names for an DOM element. | String | -- |
Style | ParameterSpecifies an inline style for a DOM element. | String | -- |
RefBack | ParameterA ForwardRef instance. You can get a reference to the internal DOM by using AntDesign.ForwardRef.Current . |
ForwardRef | -- |
RadioGroup API#
Property | Description | Type | Default Value |
---|---|---|---|
ChildContent | ParameterRadio elements for the group. Use either this or AntDesign.RadioGroup`1.Options |
RenderFragment | -- |
Disabled | ParameterIf the group is disabled or not | Boolean | -- |
ButtonStyle | ParameterButton style for the group. | RadioButtonStyle? | RadioButtonStyle.Outline |
Name | ParameterInput name for all the radios in the group | String | -- |
DefaultValue | ParameterThe default selected value for the group | TValue | -- |
OnChange | ParameterCallback executed when the selected value changes | EventCallback<TValue> | -- |
Options | ParameterOptions to display a radio for in the group. Use either this or AntDesign.RadioGroup`1.ChildContent |
OneOf<String[], RadioOption`1[]> | -- |
ValidationMessages | Validation messages for the FormItem | String[] | -- |
AdditionalAttributes | ParameterGets or sets a collection of additional attributes that will be applied to the created element. | IReadOnlyDictionary<String, Object> | -- |
Value | ParameterGets or sets the value of the input. This should be used with two-way binding. | TValue | -- |
ValueChanged | ParameterCallback that updates the bound value. | EventCallback<TValue> | -- |
ValueExpression | ParameterAn expression that identifies the bound value. | Expression<Func<TValue>> | -- |
ValuesExpression | ParameterAn expression that identifies the enumerable of bound values. | Expression<Func<IEnumerable<TValue>>> | -- |
Size | ParameterThe size of the input box. Note: in the context of a form, the `large` size is used. Available: `large` `default` `small` | String | AntSizeLDSType.Default |
CultureInfo | ParameterWhat Culture will be used when converting string to value and value to string Useful for InputNumber component. | CultureInfo | CultureInfo.CurrentCulture |
Id | ParameterID for the component's HTML | String | Uniquely Generated ID |
Class | ParameterSpecifies one or more class names for an DOM element. | String | -- |
Style | ParameterSpecifies an inline style for a DOM element. | String | -- |
RefBack | ParameterA ForwardRef instance. You can get a reference to the internal DOM by using AntDesign.ForwardRef.Current . |
ForwardRef | -- |