Radio()

Creates a Material Design radio button input. Radio buttons in the same group (same name) allow only one selection at a time.

Syntax
Result = MaterialSB::Radio(Name.s, Label.s, Flags = #Radio_Default, Parent = #Null)
Parameters
Name.s The group name. Radio buttons with the same name form a mutually exclusive group.
Label.s The label text displayed next to the radio button.
Flags Optional. Combination of radio flags for styling and state.
Parent Optional. Parent element. If #Null, uses the current parent from the stack.
Flags
FlagDescription
#Radio_DefaultStandard radio button (default)
#Radio_WithGapShows a gap between the outer circle and inner fill
#Radio_CheckedInitially selected state
#Radio_DisabledDisabled state
Return Value

Returns the radio input element. Access the checked property to get/set state.

Remarks

All radio buttons with the same Name parameter form a group where only one can be selected at a time. Use different names for independent radio groups.

Example
Procedure Main(Success)
  If Success
    MaterialSB::Row(MaterialSB::#Grid_Container)
      MaterialSB::Col(12, 6)
        MaterialSB::Card()
          MaterialSB::CardContent()
            MaterialSB::Append(MaterialSB::Header("Select Payment Method", 4))
            
            ; Radio group "payment"
            MaterialSB::Radio("payment", "Credit Card", MaterialSB::#Radio_Checked)
            MaterialSB::Radio("payment", "PayPal", MaterialSB::#Radio_WithGap)
            MaterialSB::Radio("payment", "Bank Transfer", MaterialSB::#Radio_WithGap)
            MaterialSB::Radio("payment", "Cash on Delivery", MaterialSB::#Radio_WithGap | MaterialSB::#Radio_Disabled)
            
          MaterialSB::CloseCurrentParent()
        MaterialSB::CloseCurrentParent()
      MaterialSB::CloseCurrentParent()
      
      MaterialSB::Col(12, 6)
        MaterialSB::Card()
          MaterialSB::CardContent()
            MaterialSB::Append(MaterialSB::Header("Select Shipping Speed", 4))
            
            ; Different radio group "shipping"
            MaterialSB::Radio("shipping", "Standard (5-7 days)", MaterialSB::#Radio_WithGap | MaterialSB::#Radio_Checked)
            MaterialSB::Radio("shipping", "Express (2-3 days)", MaterialSB::#Radio_WithGap)
            MaterialSB::Radio("shipping", "Overnight", MaterialSB::#Radio_WithGap)
            
          MaterialSB::CloseCurrentParent()
        MaterialSB::CloseCurrentParent()
      MaterialSB::CloseCurrentParent()
    MaterialSB::CloseCurrentParent()
  EndIf
EndProcedure

MaterialSB::Download(@Main())
See Also

Checkbox(), Switch(), InputSetCallback()