> For the complete documentation index, see [llms.txt](https://learn.mondayhero.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://learn.mondayhero.io/v1-mac-app/working-with-monday-hero/auto-component-code-generation/design-image-to-code.md).

# Images

## Images in Design to Code

Images can be used to improve the UX, capture users' attention, or differentiate the product. ImageViews are non-interactive by default. Images in the designs are automatically detected after exporting. They are saved as assets, and their code is generated by Monday Hero. Icons and logos are also classified as images. Let's have an example and understand it clearly. A simple image, an icon, a logo, and their generated codes can be seen below. &#x20;

![Images, icon, and logo example.](/files/-ML7iI9Vu3pWRnFKaWvP)

{% hint style="danger" %}
All images, logos, and icons **should be marked exportable** before exporting the design to Monday Hero with plugins. Otherwise, the code and assets are not generated for them. [Click and read here to learn more and see examples.](/v1-mac-app/getting-started/design-handoff-to-ios-android-developer.md)
{% endhint %}

### Generated iOS/Android Code of Images

Images are called and defined in `ImageView` to display image resources in both Swift/XML/Kotlin language. Let's see the generated code and its attributes.

{% tabs %}
{% tab title="iOS" %}
In iOS, Images are connected to builder and there is no additional code below since the constraints are already defined in the storyboard file automatically.

```swift
//ListPageViewController.swift 
import UIKit

class ListPageViewController: UIViewController {
	
	// MARK: - Properties
  //Connection from an Interface Builder to a UI component
	@IBOutlet private weak var photoImageView: UIImageView!
	@IBOutlet private weak var iconImageView: UIImageView!
	@IBOutlet private weak var logoImageView: UIImageView!


	override func viewDidLoad() {
		super.viewDidLoad()
		setupViews()
		setupLayout()
	}
}

extension ListPageViewController {
	private func setupViews() {

	}

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

{% endtab %}

{% tab title="Android" %}
In Android, the source, layout, constraints, etc. all generated automatically as can be seen below.

```markup
<!--activityExample.xml-->
<androidx.constraintlayout.widget.ConstraintLayout
	xmlns:android="http://schemas.android.com/apk/res/android"
	xmlns:app="http://schemas.android.com/apk/res-auto"
	xmlns:tools="http://schemas.android.com/tools"
	android:layout_width="match_parent"
	android:layout_height="match_parent"
	tools:context=".ListPageActivity"
	android:background="?attr/daisy">
	
	<ImageView
	android:id="@+id/photoImageView"
	android:layout_width="0dp"
	android:layout_height="wrap_content"
	android:src="@drawable/photo2"
	android:scaleType="centerCrop"
	android:layout_marginStart="20dp"
	android:layout_marginEnd="20dp"
	android:layout_marginBottom="13dp"
	app:layout_constraintStart_toStartOf="parent"
	app:layout_constraintEnd_toEndOf="parent"
	app:layout_constraintTop_toBottomOf="@+id/popularTextView"
	app:layout_constraintBottom_toTopOf="@+id/rosieDelTextView"/>
	
	<ImageView
	android:id="@+id/iconImageView"
	android:layout_width="wrap_content"
	android:layout_height="wrap_content"
	android:src="@drawable/icon"
	android:layout_marginEnd="19dp"
	android:layout_marginTop="14dp"
	android:layout_marginBottom="20dp"
	app:layout_constraintStart_toEndOf="@+id/likesTextView"
	app:layout_constraintEnd_toEndOf="parent"
	app:layout_constraintTop_toBottomOf="@+id/photoImageView2"
	app:layout_constraintBottom_toTopOf="@+id/photoImageView"/>
	
	<ImageView
	android:id="@+id/logoImageView"
	android:layout_width="0dp"
	android:layout_height="wrap_content"
	android:src="@drawable/logo"
	android:layout_marginTop="267dp"
	android:layout_marginBottom="211dp"
	app:layout_constraintStart_toStartOf="parent"
	app:layout_constraintEnd_toEndOf="parent"
	app:layout_constraintTop_toTopOf="parent"
	app:layout_constraintBottom_toTopOf="@+id/copyrightTextView"/>
	
</androidx.constraintlayout.widget.ConstraintLayout>
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://learn.mondayhero.io/v1-mac-app/working-with-monday-hero/auto-component-code-generation/design-image-to-code.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
