NatTag
public final class NatTag : UIView
Note
This component is available in the following variants:- ✅ Standard
With the following attribute status:
- Position:
- ✅
Center
- ✅
Left
- ✅
Right
- ✅
- Color:
- ✅
Primary
- ✅
Secondary
- ✅
Success
- ✅
Alert
- ✅
Warning
- ✅
Link
- ✅
- Size:
- ✅
Small
- ✅
Standard
- ✅
NatTag is a class that represents the tag component from the design system. The tag colors change according to the current theme configured.
These all the available styles for a NatTag:
- defaultAlert
- leftAlert
- rightAlert
Example of usage:
let tag = NatTag(style: .defaultAlert)
Requires
It’s necessary to configure the Design System with a theme or fatalError will be raised.
DesignSystem().configure(with: AvailableTheme)
-
Undocumented
Declaration
Swift
public lazy var iconView: IconView { get set }
-
Undocumented
Declaration
Swift
public lazy var label: UILabel { get set }
-
Undocumented
Declaration
Swift
public var icon: String? { get set }
-
Undocumented
Declaration
Swift
public var text: String? { get set }
-
Undocumented
Declaration
Swift
public var color: ThemeColor { get set }
-
Undocumented
Declaration
Swift
public static var currentTheme: AvailableTheme
-
Undocumented
Declaration
Swift
public init(style: Style = .defaultAlert, color: Color = .primary, size: Size = .small, icon: String? = nil, text: String? = nil, theme:AvailableTheme = .none)
-
Undocumented
Declaration
Swift
override public func draw(_ rect: CGRect)
-
Configures a text for the component’s label. The tag adjusts its width to match the text length.
Declaration
Swift
public func configure(text: String?)
-
Configures a size to the component, which changes the tag’s height and padding.
Declaration
Swift
public func configure(size: Size)
-
Configures a color for the component’s background.
Declaration
Swift
public func configure(color: Color)
-
Undocumented
Declaration
Swift
public func configure(icon: String?)
-
Size is an enum that represents the possible colors for the NatTag. The default color is
Primary
.These are all colors allowed for a NatTag:
- primary
- secondary
- success
- alert
- `warning
- link
Declaration
Swift
public enum Color
-
Undocumented
See moreDeclaration
Swift
public struct ThemeColor
-
Size is an enum that represents the possible sizes for the NatTag height. The default size is
small
.These are all sizes allowed for a NatTag:
- small
- standard
Declaration
Swift
public enum Size : CaseIterable
-
Style represents styles values for the NatTag component.
These are all allowed styles for a NatTag:
- default (centered)
- left
- right
Declaration
Swift
public struct Style