Elements Reference
This reference defines the reusable UI elements used throughout the Doctor App. Each element includes configuration rules, preview types, interaction options, and constraints.
Base Components
Feedback Components
Navigation Components
Input Components
Layout & Container Components
Text Styling Components
Media & Visual Components
File Upload & Embed Components
Button Variants
Action Metadata and Behavior
This section defines the supported action types and how UI components trigger them using metadata configuration.
Each action uses a combination of fields to control behavior, appearance, and runtime execution.
Metadata-Driven Interactions
Use action metadata to configure behaviors declaratively. This model lets UI components initiate navigation, API operations, or app interactions based on configuration rather than custom code.
This approach:
- Reduces the need for imperative logic
- Enables consistent behavior across components
- Simplifies onboarding and app-triggered flows
- Centralizes interaction patterns for easier maintenance
Action Properties
Property | Type | Default | Description |
---|---|---|---|
action | String | — | Specifies the action type to trigger when the component is activated. |
argument | String | None | Supplies a value such as a URL, message, or parameter for the action. |
autostart | Boolean | false | Runs the action automatically when the component loads. |
close | Boolean | false | Closes the popup or parent UI container after the action completes. |
banner | String | None | Displays a banner message after the action executes, if defined. |
Supported Action Types
These are the predefined action types supported by the Doctor App SDK.
ID | Action | Category | Requires argument | Description |
---|---|---|---|---|
1 | browser | General | URL | Opens a browser tab to the specified URL. |
2 | copy | General | Text | Copies the provided text to the clipboard. |
3 | permission | General | CSV | Requests runtime permission (e.g., location, camera). |
4 | page | Server | URL | Loads a new screen using a GET request. |
5 | popup | Server | URL | Opens a popup window with the specified GET request. |
6 | patch | Server | URL | Sends a PATCH request to the specified resource. |
7 | location | Server | URL | Sends a POST request containing location data. |
8 | save | Server | URL | Sends a POST request containing current field values. |
9 | camera | Video | — | Enables or disables camera input. |
10 | flip | Video | — | Switches between front and rear cameras. |
11 | mute | Video | — | Mutes or unmutes the microphone. |
Live Usage Example
This example configures a Combo
field that automatically loads a country selector when the screen opens. It opens a popup and shows a banner after completion.
{
"type": "combo",
"label": "Select Country",
"action": "popup",
"argument": "/v3/countries/list",
"autostart": true,
"close": true,
"banner": "Country list loaded"
}
Why use this?
- Enables preloading behavior without JavaScript.
- Automatically triggers when the field appears.
- Closes the popup after interaction.
- Provides user feedback via a banner.
Field Type Compatibility
The following table summarizes which component types support actions and related metadata.
Type | Category | Supports List | Supports Range | Supports Event | Examples |
---|---|---|---|---|---|
Field | Text | — | — | — | Email, Phone, Password |
Dropdown | Field | ✅ | — | ✅ | Combo, Multiselect |
Range | Field | ✅ | ✅ | — | Integer, Date, Time |