Monday Hero
Website
V2
V2
  • Overview
  • Workflow Basics
  • Getting Started
    • Installing the Desktop App
    • Log In & Create a Project
    • Prepare Design to Get the Best Code Results
    • Import Design Files into Monday Hero
      • Import Figma Design Files into Monday Hero
        • Import Your Figma Text Style and Color Library
      • Import Adobe XD Design Files into Monday Hero
      • Import Sketch Design Files Into Monday Hero
    • Share Your Project & Manage Roles
  • DESIGN TO FLUTTER
    • Convert Design to Flutter
    • Create Flutter Components
      • System Components
        • Material & Cupertino Components
        • Flutter Supported Components
      • Custom Components
    • Create Responsive Code
    • Colors
    • Text Styles
    • Assets
    • Sync Code
    • Flutter Project Base
      • Fast Start with Monday Hero Starter Project
      • Integrate Monday Hero to your Existing Project
    • Shadows, Gradients, and Other Design Elements
    • Troubleshooting Guide
      • Checklist for Design Element Review and Code Generation
      • Github Monday Hero Starter Project Troubleshooting
  • DESIGN TO SWIFT
    • Convert Design to Swift
    • Create Swift Components
      • System Components
        • Views
        • Texts
        • Images
        • Button
        • TextField/EditText
        • Text Area
        • Status Bar
        • Search Bar
        • List
        • Grid
        • Swift Supported Components
      • Custom Components
      • Video Player Code Component
    • Colors
    • Text Styles
    • Assets
    • Shadows, Gradients, and Other Design Elements
    • Firebase
      • How to get Video URL from Firebase
    • Export Code
      • Integrating Exported Files into an Existing Xcode Project
  • Hero AI Assistant
    • Hero AI Assistant
  • Design to React
    • Convert Design to React
  • Step-By-Step Tutorials
    • 🏖️Travel App
  • Support
    • Roadmap
    • Suggest a New Feature
    • Report a Bug
    • Product Announcements
    • Mail to Support
    • Frequently Asked Questions
  • Join & Follow Us
    • YouTube
    • Discord Community
    • GitHub
    • Twitter
    • LinkedIn
    • Blog
    • Instagram
    • Facebook
Powered by GitBook
On this page
  • What is a System Component?
  • How to Create A System Component

Was this helpful?

  1. DESIGN TO SWIFT
  2. Create Swift Components

System Components

PreviousCreate Swift ComponentsNextViews

Last updated 1 year ago

Was this helpful?

What is a System Component?

System components are predefined elements available in Swift, and Monday Hero enables you to create instances of these components directly from your designs. You can convert any image, text, or view into system components within your design.

When an instance of a system component is created, code is automatically generated to match the styles and overrides specified in the selected design.

Here is a list of all system components, for all the supported components list, .

Here is a button code example with System Components:

//ProfilePageViewController.swift
import UIKit

class ProfilePageViewController: UIViewController {

  // The button with an image and text
	@IBOutlet private weak var followButton: UIButton!
  
	override func viewDidLoad() {
		super.viewDidLoad()
		setupViews()
		setupLayout()
	}
}

extension ProfilePageViewController {
	private func setupViews() {
		
		// The button with an image and text
		followButton.layer.cornerRadius = 6
		followButton.layer.masksToBounds =  true 
		followButton.backgroundColor = UIColor.cerulean
		followButton.setTitle(NSLocalizedString("follow", comment: ""),for: .normal)
		followButton.setTitleColor(UIColor.daisy, for: .normal)
		followButton.titleLabel?.font = UIFont.textStyle7
		followButton.contentHorizontalAlignment = .leading 
		followButton.contentEdgeInsets = UIEdgeInsets(top: 6, left: 9 , bottom: 6, right: 9)
	
	}

	private func setupLayout() { 
		//Constraints are defined in Storyboard file.
	}
}

All the components are explained separately in the following pages.

How to Create A System Component

Start by highlighting the elements and converting them into components. Here is how to create a component instance:

  1. Select and highlight the layers: Select the layers you want to convert into a component.

  1. Right-click and choose the component from the menu: Select the class of your component. Available options include Buttons, TextViews, SearchBars, StatusBars, Lists, Grids, and more.

OR click the components button and select a component from the screen: Once you select the tag component instance, you'll see the available options on the screen. Choose one of them to continue.

  1. Set properties: For each layer, select the necessary properties such as title, image, or background image. These options will appear in a list.

  1. Name Your Variable: You will name your variable during this step. This name is used to reference your component in the code, choose a name that is easy to remember for you.

  2. Finish: Click 'Finish' to complete the creation process.

Once the component is created successfully, you'll be able to see its code on the screen. Additionally, the component type will appear in the left layer list, highlighted on the screen, and the corresponding code on the right will be updated.

Please note that you need click 'Mark as Ready' button to see the code.

Congrats! It's done. You can also create your own for reusing components.

component library
click here
UI Kit Components
A shortcut for component creation.
Right-Click Menu
Tag New Component Instance
Tag Component Instance Menu
Property List
Elavated Button Created
Mark as Ready Button