Dynamic Tab Management in B‑Side Apps: Add and Remove Pages with a Repeater

This guide walks through creating a repeater‑based tab system in a B‑side application, covering setup, layout adjustments, adding click events to generate and close tabs, and styling the selected tab, with step‑by‑step screenshots.

AI Software Product Manager
AI Software Product Manager
AI Software Product Manager
Dynamic Tab Management in B‑Side Apps: Add and Remove Pages with a Repeater

Overview

This guide explains how to create a dynamic tab interface in a B‑side application using a repeater component. The tabs can be added and removed by the user at runtime, mimicking the behaviour of browser‑style tab pages.

Procedure

Create the repeater . Drag a Repeater – Table onto the canvas and rename it Tab Page Repeater . Delete the last two columns and the last two rows so that the repeater contains a single cell. Edit the cell content to display the initial tab title, e.g., “Brand Management”.

Initial repeater layout
Initial repeater layout

Adjust the internal layout . Double‑click the repeater to open its inner canvas. By default it contains three columns; delete the two unwanted columns (Backspace) and set the border width to 0 . Drag the column borders to set appropriate widths and change the layout direction to Horizontal .

Repeater internal layout
Repeater internal layout

Add tab elements . Inside the repeater you will find a rectangle named Menu Tab . Drag a Close‑icon component onto this rectangle; it will serve as the tab‑close button.

Menu Tab with close icon
Menu Tab with close icon
Close icon positioning
Close icon positioning

Configure spacing and add a menu button . Set the repeater layout’s Column spacing to 5 . Drag a rectangle onto the canvas to act as the “Add Tab” button. Attach a click event that creates a new row in the repeater and populates it with a tab title and a close icon.

// Pseudo‑code for the Add‑Tab button click event
function onAddTabClick() {
    const newRow = repeater.addRow();
    newRow.setCellValue(0, "New Tab"); // set title
    // the close‑icon component is already part of the row template
    // optionally set a unique identifier for later removal
}
Add‑Tab button layout
Add‑Tab button layout
Repeater after adding a tab
Repeater after adding a tab
Dynamic tab creation animation
Dynamic tab creation animation

Define selected‑tab style . For the most recently created tab, configure a selected style: create an Option Group (e.g., TabGroup ), set the selected fill colour to blue ( #007BFF ) and the font colour to white ( #FFFFFF ), then mark the tab as selected. Finally, clear the repeater’s Property checkbox so that the style is applied only to the chosen tab.

Selected tab style settings
Selected tab style settings

Enable tab removal . Add a click event to the close‑icon component that deletes the row (i.e., the tab) it belongs to.

// Pseudo‑code for the close‑icon click event
function onCloseIconClick(row) {
    repeater.removeRow(row);
}
Close‑icon click event configuration
Close‑icon click event configuration
Tab removal animation
Tab removal animation
frontendUI developmentdynamic tabsrepeater
AI Software Product Manager
Written by

AI Software Product Manager

Daily updates of Xiaomi's latest AI internal materials

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.