---
updatedAt: 2025-11-05T13:29:52.000Z
agentTools:
  projectIndex: https://docs.purchasely.com/llms.txt
---

# Buttons

This page provides details on the component Button in the screen composer

# General overview

A button is a generic clickable Screen component that can be mapped with different actions.

# Configuration

## Structure of a button

Here is the structure of a button:

<Image align="center" className="border" width="400px" border={true} src="https://files.readme.io/0143e6c3178d71d97cca85383ea43d0d918b9aa3228e8f53f180a3fb919408e1-image.png" />

It is composed of a parent element (highlighted in the image above) and a set of *text collections*.

<br />

<br />

<br />

When mapped with a Purchase action (to trigger the In-App Purchase flow), button are directly mapped with  They are different from the component CTA for Plan picker, which work with a Plan picker and require the user to first choose a plan using the Pickers and then click on the CTA to trigger the Purchase.

Eg: in the Sticky button layout, the Plan picker can be put in the surface **Body**, and the CTA for Plan picker can be associated to the surface **Bottom bar**, to be always visible to the user.

<br />

## Configuring the action associated with the button

Here is the list of actions that can be associated with a button:

<Image align="center" className="border" width="400px" border={true} src="https://files.readme.io/18b10d83f8f3e67b6d013fccc61679f8ba90ac87943fa743fe128e3bcae2c482-image.png" />

* **`Purchase`**: a tap on the button will trigger an In-App Purchase Flow.

  * The Plan (and optionally the Promotional Offer) can be associated directly to the button

    <Image align="center" className="border" width="350px" border={true} src="https://files.readme.io/5c5b3ec3c1d50224d93c190df7fde475a2b44e8e24093e57d2f80c19bdcdf2d9-image.png" />

    <br />
* **`Promo code`**: a tap on the button will trigger the Promo code redemption flow.

  * On iOS, the promo-code can be redeemed in the app: in this case the user has to enter the promo code manually (which means that you should display it on the Screen itself)

    <Image align="center" className="border" width="350px" border={true} src="https://files.readme.io/1b204eb3a5c130492d6d9d3ce79286e283577b48512388b6367f75f573122e43-image.png" />

    <br />
  * Or inside the App Store: in this case you must enter the associated promo code. The user will be redirected in the App Store to redeem it and the promo code will be pre-filled.

    <Image align="center" className="border" width="350px" border={true} src="https://files.readme.io/e00a11846fcdf7bf0e6391d5d6f4b37eaf70ac5375f603aff1f304d92436d3ec-image.png" />

    <br />
* **`Open placement`**: a tap on the button will open the associated Placement

  <Image align="center" className="border" width="350px" border={true} src="https://files.readme.io/120373d99c7860b23f8b3a1f93261cb6cb4529176ffc97c76edf612eda737ddd-image.png" />

  <br />
* **`Open Screen`**: a tap on the button will open the associated Screen

  <Image align="center" className="border" width="350px" border={true} src="https://files.readme.io/e2232587a64bc37ca21126ef0e7b89b02a7e8f9629876d1b0ec1d38fa8ab9ed1-image.png" />
* **`Deeplink`**: a tap on the button will open the associated deeplink

  <Image align="center" className="border" width="350px" border={true} src="https://files.readme.io/84cbd05b95862d1db36fae40e31b33f3710f14eb9f71eb505847c65be1ae9828-image.png" />

  <br />
* **`Web page`**: a tap on the button will open the associated web page in the web browser

  <Image align="center" className="border" width="350px" border={true} src="https://files.readme.io/d9aa81b04c800121abd7eb93114e08f7e2ec090b50fbda961f76310f4a8386c9-image.png" />

  <br />
* **`Login`**: a tap on the button will handover the control to the app (using the [Action interceptor](action-interceptor)) and provide the value "Login", so that the app can display the sign-in form

  <Image align="center" className="border" width="350px" border={true} src="https://files.readme.io/49edbd8677ccde4a5549e75989f5ea2f303fab11df8b115dd6d3605b5f999b3c-image.png" />

  <br />
* **`Restore`**: a tap on the button will trigger the restore purchases action

  <Image align="center" className="border" width="350px" border={true} src="https://files.readme.io/e5c955ceae6422d69ad5d43b5d27af495af305f4188b4b3e828da53689abd250-image.png" />

  <br />
* **`Close`:** a tap on the button will close the current Screen

  <Image align="center" className="border" width="350px" border={true} src="https://files.readme.io/82303895d5d6b17c0b5f8729a0e254afcf0bffdb5e1567216afc84e217e04d97-image.png" />

  <br />
* **`Close all`**: a tap on the button will close the current Screen and all the Purchasely Screens previously opened

  <Image align="center" className="border" width="350px" border={true} src="https://files.readme.io/0b8e4dc98a0410e66c5c60b8f45a95c5df90be1e4ba367db5e8c245de7412006-image.png" />

  <br />

<br />

## Configuring the Texts associated with the button

A button has 4 different *collections of Texts*:

* promo label
* Texts above button
* Texts inside button
* Texts below button

Each collection can be associated with 1 to 4 Texts. Click on the + button to add a new Text.

<Image align="center" src="https://files.readme.io/8219004d782a07d81a3feeb231df3d009d11cd550ee14e388b56a62fee5b475d-ezgif-5-736ee43d12.gif" />

## Leveraging tags

[Tags](tags) can be used inside Texts. You can either type them directly in plain text by putting them between pairs of curly brackets (eg: `{{PRICE}}` `{{AMOUNT}}` `{{DURATION}}`). You can also click on the **`{{TAGS}}`** button in the bar just above the text input.

If you want the tag to refer to the button mapped with the element, choose the option "Use element's plan / default plan" after selecting your tag:

<Image align="center" className="border" border={true} src="https://files.readme.io/d3f414ad991b1762ae6c9fce2a8bbbd43f05157bed88c6bdf74dafff06de766f-image.png" />

* In this case, the tag should appear without parameters when displayed in the text field.
* The advantage is that the tag will automatically be updated when another picker gets selected

If you want the tag to refer to another Plan (eg: to strike through a former price), you can pick the desired Plan directly

<br />

## Configuring the Promo overlay

You can display a Promo overlay on any button / picker or CTA. A promo overlay is a Text with a background and a border. You can adjust its horizontal positioning by using changing the text alignement (left / center / right) and adjusting the left & right margin

<Image align="center" src="https://files.readme.io/2d098b184d87104964629dfc6c405359b42f3eeede0d8d429e640fb02616b38b-ezgif-3-f19a93e9c7.gif" />