Web apps

How to add a pop-up (modal)

How to add a pop-up (modal)

In TeleportHQ, you add a pop-up (a modal) from the left sidebar under Elements → Primitives → Modals. Pick a type, such as Confirmation or Form, then click Select trigger element and choose the button that opens it. TeleportHQ wires the close button (✕), the dark backdrop and the dismiss buttons for you. Pop-ups work in websites and web apps alike: adding one doesn't turn a website into a web app.

Before you start

  • Add the element that should open the pop-up first, for example a Book a table button.
  • Your role must allow creating components. Otherwise you see "Your current role does not have permission to edit components".

The five modal types in TeleportHQ

CardWhat it contains
ConfirmationTitle "Confirm Action", a question, Confirm and Cancel buttons
InformationTitle "Information", a message and an OK button
DetailsTitle "Details", an area for any content and a Close button
FormTitle "Form", Name and Email fields, Submit and Cancel buttons
SliderTitle "Gallery", an image slider, no footer buttons
The Modals group of the TeleportHQ Elements panel with its five cards: Confirmation, Information, Details, Form and Slider

Steps

1. Add the modal

  1. Open the page where the pop-up should appear.
  2. In the left sidebar, click Elements, then open the Primitives tab.
  3. Scroll to the Modals group.
  4. Click a card, for example Form.

TeleportHQ adds the modal to the top level of the page and selects it. The modal shows on the canvas so you can design it.

2. Choose what opens it

  1. The window Choose what opens this modal appears. Click Select trigger element. TeleportHQ hides the modal on the canvas so you can see your page.
  2. On the canvas (or in the layers tree), click the element visitors will click, for example your Book a table button.
  3. Click Confirm.
The TeleportHQ Choose what opens this modal window with the Later and Select trigger element buttons

If you click Later, visitors can't open the modal yet. The yellow issues chip at the top left of the editor (for example 1 issue) then counts it. Click the chip: in the Issues window, under Missing Page / Element Selections, the line An Element is Clicked for Open Form Modal (the name follows the modal type) lets you choose the element. See What do the warnings at the top of the editor mean?

3. Design and hide it on the canvas

  1. Edit the modal's title, text and fields like any other element.
  2. Select the modal. In the right panel, find Modal settings.
  3. Next to Visibility, click Hide so the modal stops covering your page while you work ("Hidden on canvas"). Click Show to see it again.
The Modal settings section in the TeleportHQ right panel, with the Visibility row and its Hide button

Check that it worked

Open Preview or your published site and click the trigger element. The pop-up opens. Click the ✕, the backdrop or the dismiss button (Cancel, OK or Close). The pop-up closes.

Troubleshooting

"Modals can only be placed at the root level. The modal has been added to the root of the page/component." You added the modal inside another element. TeleportHQ moved it to the top level of the page, which is where modals must be. Nothing else to do.

The pop-up never opens on my site No trigger element was chosen (you clicked Later). Click the yellow issues chip at the top left of the editor (for example 1 issue) and choose the element in the Issues window, under Missing Page / Element Selections.

Confirm or Submit does nothing TeleportHQ leaves these buttons for your own action, because only you know what should happen. To save the form, send an email or call another service, attach a workflow to the button. Workflows need a server, so in a website this first opens the Enable Web App features? window. See How to run a workflow when a button is clicked.

"Your current role does not have permission to edit components" Your workspace role can't add elements that create components. Ask the workspace owner or an admin.

Good to know

  • Each modal gets its own on/off value (a state), named like isFormModalOpen. You can bind Visibility to a different state from Modal settings. See How to store and use values with States.
  • Opening and closing a pop-up runs in the visitor's browser, so a modal never makes a website a web app and needs no Web App slot.
Share

Related Articles

How to add interactive elements (calendars, kanban, countdowns and more)

In TeleportHQ, you add interactive elements such as calendars, kanban boards, countdowns, tabs, QR codes and drag-and-drop lists from Elements → Primitives and set them up in the right panel; they run in the visitor's browser, so they work in websites too, and only Autocomplete, Site Search, Newsletter Signup and Upload Asset ask to make the project a web app.

What is a web app in TeleportHQ?

In TeleportHQ, a web app is a project that uses server features (workflows, user sign-in, a store, bookings, a blog or help center, an admin panel, an AI chatbot); it publishes from TeleportHQ, can't be downloaded as code, and needs a Web App slot to keep running after 7 days, while show/hide, pop-ups and browser widgets work in websites too.

How to store and use values with States

In TeleportHQ, a state is a named value, like isMenuOpen or activeTab, that elements can read and clicks can change; you create one for a page or component from the Page settings or Component settings button above the canvas, in the State tab, and it works in every project, website or web app; global states live in Project settings and need a web app.

How to run a workflow when a button is clicked

In TeleportHQ, select the button on the canvas, click On Click in the Workflows section at the top of the right panel, choose Create new workflow, then add the steps the click should run; More event types offers form, input and other browser events.

What do the warnings at the top of the editor mean?

The colored chips at the top left of the TeleportHQ editor warn about missing settings and links that lead nowhere ("N issues"), unsafe workflow code ("N security issues"), an ended subscription ("Subscription ended") or a web app that needs its own subscription ("Subscription required"); click a chip to see details and fix it.

How to show or hide elements based on a condition

In TeleportHQ, you show an element only when a condition is true, such as "stock equals 0" or "the menu is open", by selecting it, turning on the Conditional Rendering switch near the top of the right panel and building the condition from a value, an operator and a comparison value; it works in every project, website or web app.