SusRadioGroup

Exclusive radio set — children SusRadio register with the group; Model holds the selected value.
Package
SusKit · Molecules (commercial)
Props
| Name | Type | Default | |
|---|---|---|---|
Model | Prop<string> | "" | v-model |
Label | Prop<string> | "" | v-model |
Disabled | Prop<bool> | false | v-model |
Readonly | Prop<bool> | false | v-model |
Mandatory | Prop<bool> | false | v-model |
Error | Prop<string> | "" | v-model |
Slots
| Name |
|---|
(default) |
Events
| Name | Field | Payload |
|---|---|---|
Change | OnChange | string |
Style hooks
USS class contract — override appearance without touching C#. States toggle via these classes:
sus-radio-groupsus-radio-group__detailssus-radio-group__labelsus-radio-group--disabledsus-radio-group--errorsus-radio-group--mandatorysus-radio-group--readonly
Usage
xml
<template>
<sus:SusRadioGroup Label="Role"
:Model="Role.Value"
:Disabled="Disabled.Value"
:Mandatory="Mandatory.Value"
@change="OnRole">
<sus:SusRadio Label="Admin" Value="admin" Color="primary" />
<sus:SusRadio Label="User" Value="user" Color="primary" />
<sus:SusRadio Label="Guest" Value="guest" Color="primary" />
</sus:SusRadioGroup>
</template>
<script>
public Prop<string> Role = new("user");
public Prop<bool> Disabled = new(false);
public Prop<bool> Mandatory = new(false);
void OnRole(string value) { Role.Value = value; }
</script>csharp
var group = new SusRadioGroup();
group.Label.Value = "Role";
group.Model.Value = "user";
group.Add(new SusRadio { Value = { Value = "admin" }, Label = { Value = "Admin" } });
group.Add(new SusRadio { Value = { Value = "user" }, Label = { Value = "User" } });
group.Add(new SusRadio { Value = { Value = "guest" }, Label = { Value = "Guest" } });
group.OnChange += value => { /* … */ };| Prop | Role |
|---|---|
Model | Selected radio Value |
Label | Group caption above the radios |
Mandatory | Require a selection (Validate) |
Disabled / Readonly | Block interaction |
Error | Message under the group |
Notes
- Child radios call
Register/Selecton the parent — keep them under the group (default slot /Add). Rules(List<Func<string, string>>) runs on change;Validate()/ResetValidation()for forms.- Atom docs: SusRadio.