Skip to main content
Give us your valuable feedback

It will help us understand how we can serve you better

Give feedback

Components

Radio Button

Buttons are used to select only one of a limited number of choices

banner-Radio Button
Component Status Details

Status component contains a list of checks and completeness that has been tested and owned by each component

check-list-icon We don't use color as the only visual tool to convey information.
check-list-icon The component’s structure and properties include relevant options such as variant, style, size, orientation, optional iconography, decorations, selection, error state, etc.check-list-icon The title is the component name that uses the frame base component template.check-list-icon The base component name contains: .Base & "Component Name" if there is more than one.check-list-icon All component properties use the Legion foundation.
check-list-icon We can change all the parts that are connected to the component base.check-list-icon The inside of the base component remains connected to the master component.check-list-icon All variant options are not damaged when we change from one to another.check-list-icon Overriding changes to components will not reset other variants.
check-list-icon Component's already has component specs documentation.

Status

Resources

Usage

Create radio button with or without label. Radio Button is a component that allows the user to make a single choice between many options given.

How to import your theme: Legion iOS UIKit offers four themes: ThemeAGR, ThemeEazy, ThemeIHS, ThemeLGN, and ThemeMyTEnS.

import ThemeLGN

The radio button can be used without any parameter

LGNRadioButton();

Attribute

Size

You can customize the size of the button via the size enum, where BaseLGNRadioButton.Size includes lg, md and sm.

LargeMediumSmall
LGNRadioButton LargeLGNRadioButton MediumLGNRadioButton Small

Large

let radio = LGNRadioButton()
radio.size = .lg
radio.checked = true
radio.textLabel = "radio 3"

Medium

let radio2 = LGNRadioButton()
radio2.size = .md
radio2.checked = true
radio2.textLabel = "radio 2"

Small

let radio3 = LGNRadioButton()
radio3.size = .sm
radio3.checked = true
radio3.textLabel = "radio 1"

Disable

You can also disable user interaction on LGNRadioButton

DefaultDisabled
LGNRadioButton Disable CheckedLGNRadioButton Disabled

Checked Disabled

let radio = LGNRadioButton()
radio.size = .md
radio.textLabel = "radio 2"
radio.disable = false

Unchecked Disabled

let radio2 = LGNRadioButton()
radio2.size = .md
radio2.textLabel = "radio 3"
radio2.disable = true

Usage Recommendation

In order to make LGNRadioButton works correctly it required to implements LGNRadioButtonDelegate into your ViewController. Then your ViewController will add radioButtonDidTapped(selectedRadio: String) function. And then, you can add radio button logic to that function. For example look at code below.

class MainViewController: ViewController {
override func viewDidLoad() {
...
radio1.delegate = self
radio2.delegate = self
}
func update(selectedRadioId: String){

The code above will trigger update() function as Radio Button logic everytime user select a Radio Button.

Properties

PropertiesDescriptionDefault Value
disableDetermine if the radio disabled or not.false
radioIdRadio button identifier.""
selectedThe state of radio.false
sizeThe size of the radio..lg
textLabelThe label for the radio that describes it.nil