Card
The card component displays key data in a specific UI style, such as device attributes or numerical values returned by an API. This topic describes how to configure the card component.
Step 1: Add the component
-
Create a mobile application. For more information, see Create a mobile application.
-
In the mobile application editor, click the Components icon
on the far left. -
(Optional) Add a column component to configure the page layout. For more information, see Horizontal and vertical columns.
-
Above the component list on the left of the canvas, enter Card to find the component. Then, drag the component to the canvas.
For more information about adding components, see Add a component.
After you add the card component, it appears on the canvas and is selected. The Style panel on the right displays its default properties, such as Component Name, Visibility, Opacity, Size, Font Size, Title, Unit, Background Color, and Border. The panel also includes a Configure Data Source button.
Step 2: Configure the data source
-
In the Style panel on the right, under Display Data, click Configure Data Source.
-
On the data source configuration page, select a data source type and configure it.
Available data source types include Device, API, and Application Push.
NoteThe data returned by the data source must be a single-precision number, a double-precision number, or an integer.
-
Click OK.
The data on the card is updated in real time from its data source.
Step 3: Configure the style
-
In the Style panel on the right, set the card's title, unit, background color, and border style.
Some style properties support dynamic data sources. For more information, see Data sources for configuration items.
-
Adjust the component's position on the page. For more information, see General styles.
Step 4: Configure interactions
-
On the Interaction tab on the right side of the mobile application editor, click Add Interaction to set an Event and an Action.
Supported events include Click and Double-click. For example, you can set the Click event on the component to trigger the Refresh Component action, which refreshes a specified component's content.
For details, see Interaction Configuration.
-
Preview and debug the data and style of the component. For details, see Preview and Debug.