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