Components
Button
Used to initiate an action or trigger the users
Component Status Details
Status component contains a list of checks and completeness that has been tested and owned by each component
Usage
Buttons are used to initiate an action or trigger the user to open a link. Buttons can contain a combination of clear and concise labels and can be equipped with icons. How to import your theme: Legion iOS UIKit offers four themes: ThemeAGR, ThemeEazy, ThemeIHS, ThemeLGN, and ThemeMyTEnS.
import ThemeLGN
Variant
LGNButton have 4 component variants:
Solid | Outline | Transparent | Soft |
---|---|---|---|
![]() | ![]() | ![]() | ![]() |
Solid
let button = LGNButton()button.label = "Button"button.variant = .solid
Outline
let button = LGNButton()button.label = "Button"button.variant = .outline
Transparent
let button = LGNButton()button.label = "Button"button.variant = .transparent
Soft
let button = LGNButton()button.label = "Button"button.variant = .soft
Size
You can customize the size of the button via the size
enum, where BaseLGNButton.Size
includes lg
, md
and sm
.
Size | Solid | Outline | Transparent | Soft |
---|---|---|---|---|
Large | ![]() | ![]() | ![]() | ![]() |
Medium | ![]() | ![]() | ![]() | ![]() |
Small | ![]() | ![]() | ![]() | ![]() |
Large
Solid
let button = LGNButton()button.label = "Button"button.variant = .solidbutton.size = .lg
Outline
let button = LGNButton()button.label = "Button"button.variant = .outlinebutton.size = .lg
Transparent
let button = LGNButton()button.label = "Button"button.variant = .transparentbutton.size = .lg
Soft
let button = LGNButton()button.label = "Button"button.variant = .softbutton.size = .lg
Medium
Solid
let button = LGNButton()button.label = "Button"button.variant = .solidbutton.size = .md
Outline
let button = LGNButton()button.label = "Button"button.variant = .outlinebutton.size = .md
Transparent
let button = LGNButton()button.label = "Button"button.variant = .transparentbutton.size = .md
Soft
let button = LGNButton()button.label = "Button"button.variant = .softbutton.size = .md
Small
Solid
let button = LGNButton()button.label = "Button"button.variant = .solidbutton.size = .sm
Outline
let button = LGNButton()button.label = "Button"button.variant = .outlinebutton.size = .sm
Transparent
let button = LGNButton()button.label = "Button"button.variant = .transparentbutton.size = .sm
Soft
let button = LGNButton()button.label = "Button"button.variant = .softbutton.size = .sm
Icons
You can insert icon in button on the left side, right side leftImage
and rightImage
Icon Position | Solid | Outline | Transparent | Soft |
---|---|---|---|---|
Left | ![]() | ![]() | ![]() | ![]() |
Right | ![]() | ![]() | ![]() | ![]() |
Left Image
Solid
let button = LGNButton()button.label = "Button"button.variant = .solidbutton.leftImage = UIImage(named: "square.and.arrow.up.circle.fill")
Outline
let button = LGNButton()button.label = "Button"button.variant = .outlinebutton.leftImage = UIImage(named: "square.and.arrow.up.circle.fill")
Transparent
let button = LGNButton()button.label = "Button"button.variant = .transparentbutton.leftImage = UIImage(named: "square.and.arrow.up.circle.fill")
Soft
let button = LGNButton()button.label = "Button"button.variant = .softbutton.leftImage = UIImage(named: "square.and.arrow.up.circle.fill")
Right Image
Solid
let button = LGNButton()button.label = "Button"button.variant = .solidbutton.rightImage = UIImage(named: "square.and.arrow.up.circle.fill")
Outline
let button = LGNButton()button.label = "Button"button.variant = .outlinebutton.rightImage = UIImage(named: "square.and.arrow.up.circle.fill")
Transparent
let button = LGNButton()button.label = "Button"button.variant = .transparentbutton.rightImage = UIImage(named: "square.and.arrow.up.circle.fill")
Soft
let button = LGNButton()button.label = "Button"button.variant = .softbutton.rightImage = UIImage(named: "square.and.arrow.up.circle.fill")
Disabled
Make buttons appear inactive by setting the boolean disable
to true
.
Solid | Outline | Transparent | Soft |
---|---|---|---|
![]() | ![]() | ![]() | ![]() |
let button = LGNButton()button.label = "Button"button.disable = true
Show Activity
Solid | Outline | Transparent | Soft |
---|---|---|---|
![]() | ![]() | ![]() | ![]() |
let button = LGNButton()button.label = "Button"button.loading = true