Skip to main content

Appmaker Config Form

Appmaker Form config is used to render the form in the Appmaker Dashboard. The form is rendered based on the JSON schema provided in the attributesSchema property of the block schema.

Example

{
"properties": [
{
"id": "background_color",
"label": "Theme AccentColor",
"uiType": "ColorPicker",
"type": "string"
},
{
"id": "title",
"label": "Title",
"type": "string",
"description": "Sample Description"
},
{
"id": "slider_type",
"type": "string",
"title": "Slider Type",
"uiType": "RadioGroup",
"options": [
{
"label": "Type 1",
"value": "type-2"
},
{
"label": "Type 2",
"value": "type-2"
}
]
}
]
}

Output

App Screenshot

Standard attributes

The following attributes are standard for all input settings. However, there might be additional attributes for specific input types.

AttributeDescriptionRequired
uiTypeThe type of UI component to render.Yes
typeThe type of input.Yes
labelThe label of the input.Yes
descriptionThe description of the input.No

Input types

string

The string input type is used for text input.

{
"properties": [
{
"id": "name",
"type": "string",
"label": "Sample Name",
"description": "Sample Description"
}
]
}

The above code will generate the following input:

App Screenshot

Text Area

{
"properties": [
{
"id": "details",
"type": "string",
"label": "Details",
"description": "Some description",
"inputType": "textArea",
"rows": 10
}
]
}

The above code will generate the following input:

App Screenshot

JSON

{
"properties": [
{
"id": "config",
"type": "string",
"label": "Config",
"description": "Some description",
"uiType": "json"
}
]
}

The above code will generate the following input:

App Screenshot

RadioGroup

You can set the uiType to RadioGroup to render the input as a radio group. You can also set the options attribute to set the options for the radio group.

{
"properties": [
{
"id": "selectBannerDesign",
"type": "string",
"uiType": "RadioGroup",
"title": "Banner Design",
"options": [
{
"label": "Type 1",
"value": "type-1"
},
{
"label": "Type 2",
"value": "type-2"
},
{
"label": "Type 3",
"value": "type-3"
}
]
}
]
}

The above code will generate the following input:

App Screenshot

ColorPicker

You can set the uiType to ColorPicker to render the input as a color picker.

{
"properties": [
{
"id": "themeFontColor",
"uiType": "ColorPicker",
"type": "string",
"label": "Theme Font Color"
}
]
}

The above code will generate the following input:

App Screenshot

Switch

You can set the uiType to Switch to render the input as a switch.

{
"properties": [
{
"id": "show_banner",
"type": "string",
"uiType": "switch",
"label": "Show banner"
}
]
}

Other supported properties are:

ParametersDescriptionvalue
defaultValueTo set the default value of the switchfalse

The above code will generate the following input:

App Screenshot

Media library

You can set the uiType to appmaker-media-library to render the media modal.

{
"properties": [
{
"id": "image",
"type": "string",
"uiType": "appmaker-media-library",
"label": "Product Image"
}
]
}
{
"properties": [
{
"id": "custom_name",
"type": "appmaker-media-library",
"label": "Sample Name",
"description": "Sample Description",
"mediaTypes": ["video", "image"],
"dropzoneHelperText": "PNG, JPG, GIF, MP4 up to 2MB",
"acceptedFile": "image/*"
}
]
}
ParametersDescriptiondata typevaluesrequired
mediaTypesTo show and upload the media typesArray["video","image"]false
dropzoneHelperTextoverride text shown inside media library when uploadingStringanyfalse
acceptedFileoverride the accepted file while uploadingstringAny MIME type (example: "video/mp4")false
disableImageResizeTo disable image resize.Default is falseBooleantrue/falsefalse
maxWidthTo set max width for the imageString or IntegerInteger Valuefalse
maxHeightTo set max height for the image (If maxWidth is set maxHeight is omitted)String or IntegerInteger Valuefalse

Above code will generate the following form:

App ScreenshotApp ScreenshotApp Screenshot

Select

You can set the uiType to Select to render the input as a dropdown.

{
"properties": [
{
"id": "filterType",
"type": "string",
"uiType": "select",
"label": "Filter type",
"options": [
{
"label": "Product Type",
"value": "Product Type"
},
{
"label": "Color",
"value": "Color"
}
]
}
]
}
ParametersDescriptiondata typevaluesrequired
creatablecustom createbooleantrue/falsefalse
multicreate multiple inputbooleantrue/falsefalse
App Screenshot

infinite-text

You can set the uiType to infinite-text to render the infinite text box.

{
"properties": [
{
"id": "imageTags",
"type": "array",
"uiType": "infinite-text",
"label": "Image tags"
}
]
}
App Screenshot

infinite-form

{
"properties": [
{
"id": "coupons",
"type": "array",
"uiType": "infinite-form",
"label": "Mobile app coupon list",
"properties": {
"enable": {
"type": "string",
"label": "Enable",
"uiType": "switch"
},
"coupon": {
"type": "string",
"label": "Coupon"
},
"min_amount": {
"type": "string",
"label": "Min Amount"
},
"description": {
"type": "string",
"label": "Description"
}
}
}
]
}
App Screenshot

Example 2

{
"properties": [
{
"id": "filterType",
"type": "string",
"uiType": "select",
"label": "Filter type",
"creatable": true,
"options": [
{
"label": "Product Type",
"value": "Product Type"
},
{
"label": "Color",
"value": "Color"
}
]
},
{
"id": "show_banner",
"type": "string",
"uiType": "Switch",
"label": "Show banner"
},
{
"id": "selectBannerDesign",
"type": "string",
"uiType": "RadioGroup",
"title": "Banner Design",
"options": [
{
"label": "Type 1",
"value": "type-1"
},
{
"label": "Type 2",
"value": "type-2"
},
{
"label": "Type 3",
"value": "type-3"
}
]
}
]
}

Above code will generate the following form:

App Screenshot

Image Radio Group

You can set the uiType to image-radio to render the input as a image radio group. You can also set the options attribute to set the options for the radio group.

{
"properties": [
{
"id": "selectBannerDesign",
"type": "string",
"uiType": "image-radio",
"title": "Banner Design",
"options": [
{
"label": "Sample Name 1",
"description": "Last message sent an hour ago",
"imgSrc": "https://picsum.photos/200?random=1"
},
{
"label": "Sample Name 2",
"description": "Last message sent an hour ago",
"imgSrc": "https://picsum.photos/200?random=2"
},
{
"label": "Sample Name 3",
"description": "Last message sent an hour ago",
"imgSrc": "https://picsum.photos/200?random=3"
}
]
}
]
}

The above code will generate the following input:

App Screenshot

Range Slider

{
"properties": [
{
"id": "gap",
"type": "string",
"uiType": "RangeSlider",
"label": "Gap",
"default": 50,
"min": 1,
"max": 500
}
]
}

The above code will generate the following input:

App Screenshot
ParametersDescription
defaultTo set the default value of the slider
minTo set the minimum value of the slider
maxTo set the maximum value of the slider

Date Time Picker

{
"properties": [
{
"id": "chooseTime",
"type": "string",
"uiType": "date-time",
"label": "Time to show",
"title": "choose me",
"minDate": "2024-01-01",
"maxDate": "2028-12-31"
}
]
}
App Screenshot
ParametersDescriptionDefault Value
titleTitle of the date picker
disableClockDisable the clock for time selectiontrue
minDateMinimum selectable date (YYY-MM-DD)
maxDateMaximum selectable date (YYY-MM-DD)
dayPlaceholderPlaceholder for day input"dd"
monthPlaceholderPlaceholder for month input"mm"
yearPlaceholderPlaceholder for year input"yyyy"
secondPlaceholderPlaceholder for second input"ss"
minutePlaceholderPlaceholder for minute input"mm"
hourPlaceholderPlaceholder for hour input"hh"
classNameAdditional class for styling

Conditional

{
"properties": [
{
"id": "conditional-block",
"type": "conditional",
"label": "Label",
"placeholder": "Choose options",
"options": [
{
"id": "option-1",
"label": "Option 1",
"properties": [
{
"id": "option-1-sub",
"type": "string",
"label": "Option 1 sub"
}
]
},
{
"id": "option-2",
"label": "Option 2",
"properties": [
{
"id": "option-2-sub-1",
"type": "string",
"label": "Option 2 sub 1"
},
{
"id": "option-2-sub-2",
"type": "string",
"label": "Option 2 sub 2"
}
]
}
]
}
]
}
App Screenshot

Collections

{
"properties": [
{
"id": "collectionId",
"label": "Select collection",
"type": "collections"
}
]
}
App Screenshot
App Screenshot
ParametersDescriptionDefault Value
isMultiTo select multiple optionsfalse

in-app-page

Form type for selecting the in-app pages. This will allow you to select the in-app pages from the dashboard.

{
"properties": [
{
"id": "pageId",
"type": "string",
"uiType": "in-app-page",
"label": "Select Page",
"isMulti": false
}
]
}
App Screenshot
ParametersDescriptionDefault Value
isMultiTo select multiple optionsfalse

Form types for styling

layout-styles

Form type for styling the layout of the app blocks. Using this form type will allow you to apply styles from the dashboard to the app components. You can apply styles mentioned in view-style-props

{
"properties": [
{
"id": "containerStyles",
"type": "string",
"uiType": "layout-styles",
"label": "Block Container Styles"
}
]
}

text-styles

Form type for styling the text of the app blocks. Using this form type will allow you to apply styles from the dashboard to the app components. You can apply styles mentioned in text-style-props

{
"properties": [
{
"id": "textStyles",
"type": "string",
"uiType": "text-styles",
"label": "Title Text Styles"
}
]
}

image-styles

Form type for styling the image of the app blocks. Using this form type will allow you to apply styles from the dashboard to the app components. You can apply styles mentioned in image-style-props

{
"properties": [
{
"id": "imageStyles",
"type": "string",
"uiType": "image-styles",
"label": "Image Styles"
}
]
}
App Screenshot

Additional form types

group

Form type for grouping multiple properties together. This is useful when you want to group multiple properties together and apply. This will help to organize the properties in the dashboard.

{
"properties": [
{
"id": "blockStyles",
"type": "string",
"uiType": "group",
"label": "Main Styles",
"description": "This will apply styles to the main block of the component.",
"properties": [
{
"id": "containerStyles",
"type": "string",
"uiType": "layout-styles",
"label": "Block Container Styles"
},
{
"id": "textStyles",
"type": "string",
"uiType": "text-styles",
"label": "Title Text Styles"
}
]
}
]
}
App Screenshot

title

Form type for adding a title to the form. This is useful when you want to add a title to the form or in between the properties. This will help to organize the properties in the dashboard.

{
"properties": [
{
"id": "title",
"type": "string",
"uiType": "title",
"label": "Title",
"description": "This is the title of the component.",
"size": "h1"
}
]
}
PropTypeDescription
sizestringSize of the title. Possible values are h1, h2, h3
App Screenshot