Components

What are components, and when should I use them?

What are components, and when should I use them?

A component in TeleportHQ is a reusable block, such as a navigation bar, a footer or a product card, that you design once and place on as many pages as you like. Each placed copy is called an instance. When you change the main component, every instance updates. Each instance can still show its own text, image or link through component properties (props).

When to use a component

Use a TeleportHQ component when the same block appears in more than one place:

  • A navigation bar and a footer that should look the same on every page.
  • A card repeated with different content, for example a "Team member" card with a different photo and name each time.
  • A call-to-action banner you want to update once and see everywhere.

Don't make a component for a block that appears only once. Copy and paste is fine for one-off variations. See How to copy, paste and duplicate elements.

Components are similar to components in Figma or symbols in Sketch.

Main component and instances

Every TeleportHQ component has two sides:

  • The main component lives in the Components folder of the Pages, Components & Tree View panel in the left sidebar. It opens in its own canvas tab, on a checkerboard background.
  • Instances are the copies placed on pages or inside other components. On the canvas, an instance has a purple outline instead of the usual blue one.
The Components folder in the TeleportHQ Pages, Components & Tree View panel, listing the Navigation, Footer and Logo components

Inside an instance on a page you can't move, style or delete the elements one by one. You change them in the main component, and the change reaches every instance. You can still style the instance as a whole, for example give it a margin.

Sites made with the AI Website Builder already use components: the navigation, the footer and the logo are components. When you pick a Navbar or Footer design from Elements → Sections, it also becomes a component, placed on every page. See How to add ready-made sections.

Make each instance different

TeleportHQ gives you three ways to vary instances:

Everything you can do with components

Who can create and edit components

  • In a shared workspace, the Owner, Admin and Designer roles can create, edit and delete components. The Editor role and the viewer roles can't.
  • A project on a trial can hold up to 1,000 components. Paid plans have no component limit. When a workspace's plan has expired, no new components can be created. When you reach the limit, TeleportHQ shows "You reached the maximum number of components allowed in a project."

Good to know

  • Components have no thumbnails in the Components list. Use clear names, for example PricingCard.
  • A component with no instances shows an info icon with the tooltip "Component is not used".
  • With a component open, the button above the top right of the canvas reads Component settings (on a page it reads Page settings). It holds the component's Props and State.
  • Components that a feature created, such as a blog's article card or a store's product card, can be restyled with Refine. See How to restyle generated login, blog or store components with "Refine".
Share

Related Articles

How to create a component

In TeleportHQ, create a component by right-clicking elements you already designed and choosing Make Component, or start a blank one with the + button on the Components folder and New Component (Ctrl+Alt+K).

How to edit a component and update every copy

In TeleportHQ, double-click a component instance (or click the component in the Components folder) to open the main component in its own tab; every change you make there updates all its copies on every page.

How to add editable settings to a component (props)

In TeleportHQ, open the main component, click the connect (plug) icon next to a text, image or link field and choose Create Prop (or use Component settings → Props → Create new prop); each copy of the component can then set its own value in Component Properties.

How to change one copy of a component without changing the others

In TeleportHQ, change one copy (instance) of a component by editing its values in the Component Properties section of the right panel, or right-click it and choose Detach Instance to turn it into normal elements that no longer update with the main component.

How to use slots to put different content inside a component

In TeleportHQ, open a component and add a Slot element (Elements → Primitives → Layout, shortcut S) where the variable content should go; then, on each copy of the component on a page, drag any elements or components into that slot.

How to copy elements and components to another project

In TeleportHQ, copy an element or section with Ctrl+C (or right-click a component in the Components list and choose Copy), open the other project, select where it should go and press Ctrl+V; its styles, fonts, images and components come along.