UI Types
This section describes the controls (component style configuration items) that are supported by a custom component. You can use the type field defined in the gui.json file to define the control type and configuration.
Supported Types
The options of type are:
- input: text input box. See Text Input Box.
- number: numeric control, which supports input and customization of maximum and minimum values. See Numeric Control.
- select: drop-down list, which supports enabling filtering and custom input. See Drop-Down List.
- color: color selector. See Color Selector.
- checkbox: check box. See Check Box.
Text Input Box
Field |
Mandatory |
Type |
Description |
---|---|---|---|
value |
Yes |
String |
Value in the text box. |
An example is shown below:
1 2 3 4 5 6 7 |
{ "label": "Init value", "name": "initvalue", "type": "input", "value": "" } |
Numeric Control
Numeric control
Field |
Mandatory |
Type |
Description |
---|---|---|---|
value |
Yes |
Number |
Value of the numeric control. The default value is 0. |
min |
No |
Number |
Minimum value. |
max |
No |
Number |
Maximum value. |
step |
No |
Number |
Adjustment range. The default value is 1. |
1 2 3 4 5 6 7 8 9 10 |
{ "label": "Size", "name": "size", "type": "number", "min": 0.1, "max": 1.5, "step": 1, "value": 14 } |
Drop-Down List
Field |
Mandatory |
Type |
Description |
---|---|---|---|
value |
Yes |
String |
Value selected from the drop-down list. The value corresponds to value in options. |
options |
Yes |
Array<Object> |
All the options contained in the drop-down list. |
Example data:
{ "label": "Font weight", "name": "fontWeight", "type": "select", "options": [ { "key": "Normal", "value": "normal" }, { "key": "Bold", "value": "bold" } ], "value": "normal" }
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot