# Texts

## Text Design to Code

Texts are automatically detected and their code is generated by Monday Hero. With texts, you can describe an interface element or provide messages. Texts display static text with no editing features. A Simple label image is and its code is shown below.

![A label example.](/files/-MGxGDlge5EgSoQidZwq)

### Generated iOS/Android Code of Texts

{% tabs %}
{% tab title="iOS" %}

## Label

Texts are called as `Label` in the Swift language. Let's see the generated code and its attributes.

```swift
//HomePageViewController.swift 
import UIKit

class HomePageViewController: UIViewController {

//Connection from an Interface Builder to a UI component
@IBOutlet private weak var simpleExampleLabel: UILabel!

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

}

extension HomePageViewController {
	private func setupViews() {
	
		//Text properties
		simpleExampleLabel.text = NSLocalizedString("simple.example", comment: "")
		simpleExampleLabel.textColor = UIColor.black
		simpleExampleLabel.numberOfLines = 0
		simpleExampleLabel.font = UIFont.textStyle10
		simpleExampleLabel.textAlignment = .center
		
}
```

{% endtab %}

{% tab title="Android" %}

## TextView

Texts are called as `TextView` in the Android Kotlin/Java XML. Let's see the already generated code and its attributes.

```markup
<!--activityExample.xml-->

	<TextView
	android:id="@+id/titleTextView"
	android:layout_width="0dp"
	android:layout_height="wrap_content"
	android:text="@string/title_text"
	style="@style/textStyle13"
	android:textAlignment="center"
	android:textColor="?attr/black"
	android:layout_marginStart="39dp"
	android:layout_marginEnd="39dp"
	android:layout_marginBottom="12dp"
	app:layout_constraintStart_toStartOf="parent"
	app:layout_constraintEnd_toEndOf="parent"
	app:layout_constraintTop_toBottomOf="@+id/mondayHeroLogoImageView"
	app:layout_constraintBottom_toTopOf="@+id/descriptionTextView"/>
	
```

```markup
<!--strings.xml-->
<string name="title_text">"SimpleText"</string>
<string name="description_text">"This is a textView example and textViews are better while it kept short and legible."</string>
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: 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:

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

The question should be specific, self-contained, and written in natural language.
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.
