Import
import {
RadioGroup ,
RadioGroupItem
} from '@strongtie/design-system/radiogroup' ;
Usage
< RadioGroup defaultValue = "option-1" >
< div className = "radio-group-container" >
< div className = "radio-item-container" >
< RadioGroupItem
id = "option-1"
value = "option-1"
/>
< Label htmlFor = "option-1" >
Option 1
</ Label >
</ div >
< div className = "radio-item-container" >
< RadioGroupItem
id = "option-2"
value = "option-2"
/>
< Label htmlFor = "option-2" >
Option 2
</ Label >
</ div >
< div className = "radio-item-container" >
< RadioGroupItem
id = "option-3"
value = "option-3"
/>
< Label htmlFor = "option-3" >
Option 3
</ Label >
</ div >
</ div >
</ RadioGroup >
<RadioGroup> PropsIf true, the radio group will be disabled.
If true, the radio group is required.
The name of the radio group.
The controlled value of the radio group.
The default value of the radio group.
Callback function that is called when the value changes.
orientation
"horizontal" | "vertical"
default: "horizontal"
The orientation of the radio group.
dir
"ltr" | "rtl"
default: "ltr"
The direction of the radio group.
If true, the radio group will loop.
If true, the radio group will render as a child component.
<RadioGroupItem> PropsThe value of the radio group item.
If true, the radio group item will be disabled.
If true, the radio group item is required.
If true, the radio group item will render as a child component.
Usage Examples Basic
Controlled
Vertical Orientation
With Disabled Option
< RadioGroup defaultValue = "option-1" >
< div className = "radio-group-container" >
< div className = "radio-item-container" >
< RadioGroupItem id = "option-1" value = "option-1" />
< Label htmlFor = "option-1" > Option 1 </ Label >
</ div >
< div className = "radio-item-container" >
< RadioGroupItem id = "option-2" value = "option-2" />
< Label htmlFor = "option-2" > Option 2 </ Label >
</ div >
< div className = "radio-item-container" >
< RadioGroupItem id = "option-3" value = "option-3" />
< Label htmlFor = "option-3" > Option 3 </ Label >
</ div >
</ div >
</ RadioGroup >
Styling Classes The following CSS classes are applied by the Radio Group components:
radio-group – Root container for the radio group with proper ARIA attributes
radio-group-item – Individual radio button input element
radio-group-item-indicator – Container for the selected state indicator
For more examples, visit the Storybook . < StudsRadioGroup @bind-Value = @value TValue = "int" >
< Items >
< StudsRadio Text = "Orders" Value = "1" />
< StudsRadio Text = "Employees" Value = "2" />
< StudsRadio Text = "Customers" Value = "3" />
</ Items >
</ StudsRadioGroup >
<StudsRadioGroup> ParametersIf true, the radio group will be disabled.
The name of the radio group.
The controlled value of the radio group.
The default value of the radio group.
Event callback that is triggered when the value changes.
Gets or sets the value property.
Gets or sets the text property.
Gets or sets the disabled property.
Gets or sets the visible property.
Gets or sets the data source.
Orientation
"Horizontal" | "Vertical"
default: "Orientation.Horizontal"
The orientation of the radio group.
Gets or sets the items of the radio group.
Event callback that is triggered when the value changes.
The expression that represents the value.
Attributes
Dictionary<string, object>
Specifies additional custom attributes that will be rendered by the component.
MouseEnter
EventCallback<ElementReference>
Gets or sets the callback that is invoked when the mouse enters an item.
MouseLeave
EventCallback<ElementReference>
Gets or sets the callback that is invoked when the mouse leaves an item.
A callback that will be invoked when the user right-clicks the component. Commonly used to display a context menu.
Culture
CultureInfo
default: "CultureInfo.CurrentCulture"
Gets or sets the culture used to display localizable data (numbers, dates). Set by default to “CultureInfo.CurrentCulture”.
Gets or sets the inline CSS style.
Gets or sets a value indicating whether this “T:Studs.StudsComponent” is visible. Invisible components are not rendered.
<StudsRadioGroupItem> ParametersThe text of the radio group item.
If true, the radio group item will be disabled.
InputAttributes
Dictionary<string, object>
The attributes of the input element.
Usage Examples Basic
With Data Source
Vertical Orientation
With Change Handler
Custom Template
< StudsRadioGroup @bind-Value = "selectedValue" TValue = "int" >
< Items >
< StudsRadio Text = "Orders" Value = "1" />
< StudsRadio Text = "Employees" Value = "2" />
< StudsRadio Text = "Customers" Value = "3" />
</ Items >
</ StudsRadioGroup >
@code {
int selectedValue = 1 ;
}
Styling Classes The following CSS classes are applied by the Radio Group components:
radio-button-list – Root container for the radio group
radio-button-list.-horizontal – Horizontal layout modifier
radio-button-list.-vertical – Vertical layout modifier
radiobutton.-wrapper – Individual radio item wrapper
radiobutton.-button – Clickable radio button container
radiobutton.-accessible-helper – Hidden accessibility helper containing actual input
radiobutton.-box – Visual radio button representation
radiobutton.-box.-active – Selected state styling
radiobutton.-icon – Icon element for selected state indicator
radiobutton.-label – Text label for radio option
radiobutton.-template – Custom template content wrapper
For more examples, visit the Storybook .