Skip to content
← All insights

Visual components6 min read

How to reuse a header across mobile app screens

Turn a finished mobile header into a linked visual component in Appsanic. Learn which changes affect every copy, when to detach one and how to test the result.

Modular ceramic tiles arranged into repeating groups on a pale surface

Link elements whose future edits should travel together. Keep page-specific content outside the shared component, and test one shared change and one local change before using it throughout the app.

A class-booking app has three pages: Schedule, My bookings and Account. Each starts with the studio mark and a narrow strip carrying the same opening-hours note. The owner changes Saturday hours. On two pages the correction goes live and on the third the studio still appears closed. The original designer copied the strip three times. They looked identical, but there was no relationship between them.

Choose the boundary before choosing the command

Put the three screens side by side and circle only the elements that should change together. In this example the mark, opening-hours text and space between them belong together. The page heading and back action belong to the individual page. If you include “My bookings” inside the shared strip, renaming the page can rename all three headers. The phrase “appears on every page” tells you where a component occurs. It does not tell you which content every instance should share.

Build one working strip first. Try the longest opening-hours note you realistically expect, and put it on the narrowest page. A reusable component multiplies its good decisions and its cramped ones. Give the containing layer a meaningful name so the boundary remains easy to recognise after the page acquires more layers.

Turn the finished strip into a linked visual component

  1. In Design, select the strip or select its neighbouring layers within the same parent. A selection spread across different parents needs to be organised before it can become one component.
  2. In the Inspector’s Custom component section, choose Create custom component. Name it “Studio hours strip”. The selected layers become the first copy in place.
  3. Open another page, find the strip in Custom Components, and insert it. Put the page’s unique heading beside it. Repeat on the third page.
  4. Change the hours text through one copy. Open the other pages and look at the actual text. This simple change establishes that all three belong to the same definition.

When several selected layers are wrapped together, the new container takes direction and spacing from its parent. Look at the strip before and after the operation. If an extra gap appears, inspect both the wrapper’s inside spacing and the outside space applied where the copy sits. The Appsanic custom component guide describes the creation rules and linked-copy controls.

Read the selection before naming it

Here is the creation step with one built-in Page header selected. Open Custom component in the Inspector and look at the selection summary. In the example the dialog says 1 layer selected and names Page header. If you intended to include a separate opening-hours label as well, cancel here and select the two neighbouring layers inside the same container. If the parent is a layer group, select its contents. Naming a one-layer selection “Studio hours strip” does not pull in anything else on the page.

Give the definition a name that says what a future editor will use it for. “Studio hours strip” still makes sense when Saturday opening moves from nine to ten. A name like “Saturday 9 am” becomes misleading the first time the business changes its hours. Keep the individual page names outside the selection so they can still tell your users where they are.

Decide what should happen when one page differs

Inside space, colours, shared text and the layer structure travel with edits to the shared design. Individual visual copies retain placement details such as their size, outside space and alignment in the parent. A wide copy on Schedule can sit above a compact copy on Account without requiring two independent definitions. To verify the distinction, change the outside space on Account, then reopen Schedule and check its position.

Suppose a one-off event page needs a special closing time and a second line for the venue. Select that copy and choose Make this copy independent before editing the shared content. Its ordinary layers remain on the page and stop following future changes. Leave a descriptive layer name such as “Winter event hours” so the next editor can tell why it differs. If every page requires different text or a different action while sharing behaviour, consider a code component with explicit per-copy properties and events. The visual and code workflows are documented separately because their edit behaviour differs.

The sharing panel below appeared after adding a second copy from the library. It says Used 2 times. You can use that number to rehearse a seasonal exception before building the other pages.

The Studio hours strip sharing panel shows Used 2 times and offers Make this copy independent.

Give the special-event copy its own name in Layers. Select Make this copy independent there, then select the original shared strip again. Check that its count has fallen by one. Write “Closed for the studio workshop” on the independent copy. Open the ordinary booking page and read the complete header, including the page title. Finally make a routine change to the original hours and revisit the event page. If both sentences end up where you intended, the person who updates the shop next month has a repeatable way to handle exceptions.

Verify a future maintenance task today

Ask someone who did not build the strip to change one opening time and show you every affected screen. Then ask them to widen just one copy. If they can predict both results, the boundary is understandable. If they accidentally edit the page title everywhere, undo the change and move the title outside the shared selection. This test measures the cost of the next edit, which is the reason to reuse anything in the first place. Use the Inspector guide to distinguish the setting on the selected component from its parent’s layout.

Replace an old lookalike without losing its page layout

Suppose the studio already has three headers. You turn the Schedule header into a component, then notice the two older headers still look right. Open the component card in Custom Components and check its copy count. One means only Schedule follows the definition. That count gives you a starting point even when all three screens use identical text.

On My bookings, note where the original strip sits in Layers, its width and the space above it. Insert the linked strip beside the original. Give it the same placement, then remove the old strip. Repeat on Account. The library should now report three copies. Check the layout at two phone widths to catch page-specific spacing that was easy to overlook.

Make one conspicuous temporary edit, such as changing “Saturday” to “Saturday by appointment”. Check the three pages in Preview. If a screen still shows the old sentence while the library counts three copies, inspect its layers for an original strip sitting over the new one. Remove the redundant layer, restore the real hours once and verify the final wording on all three pages.

Open the custom component guide

Published

Analytics cookies

With your OK, we use Google Analytics to count visits and see which pages people find useful. It sets cookies and sends Google details of your visit, such as the pages you open. Nothing loads unless you accept. Cookie Policy