HomeDocs
Skip to main content

Page Configuration

In app.json, certain configurations can also be applied to individual pages. You can use the .json file corresponding to a specific page to configure its behavior.

Page-specific configuration items will override the same configuration items in app.json (styling-related configurations belong to the window property in app.json, but you don't need to specify the window field here). The specific values and meanings can be referenced in the Global Configuration documentation.

The file content is a JSON object with the following properties:

Configuration Options

PropertyTypeRequiredDefaultDescriptionMinimum Version
enablePullDownRefreshBooleanNofalseWhether to allow pull-down refresh.1.0.0
enablePullUpRefreshBooleanNofalseWhether to allow pull-up refresh.1.0.0
enableTransparentStatusBarBooleanNofalseWhether to enable transparent TitleBar for immersive status bar.1.0.0
enableNavigationBarLoadingBooleanNotrueWhether to show TitleBar loading progress.1.0.0
navigationBarTitleTextStringNoDefault title for the page.1.0.0
navigationStyleStringYesNavigation bar style. See supported values below.
navigationBarBackgroundColorHexColorYesBackground color of the navigation bar and status bar, e.g., #FFFFFF.1.0.0
navigationBarTextStyleStringYesText color of the navigation bar and status bar. Only supports black or white.1.0.0
navigationBarIconStyleStringYesIcon color style of the navigation bar. Only supports black or white.1.0.0
navigationBarHomeActionStringNohomeAction for the home button in the navigation bar. Supported values: home (returns to the main page), back (goes back one level), all (displays both home and back buttons). See explanations below.
refreshHeaderStyleStringNoStyle of the refresh header: default (default style), custom (custom style). Custom refresh headers must provide the following properties and meet certain requirements: refreshHeaderCustomLoadingGif, refreshHeaderCustomSuccessGif, refreshHeaderCustomLoading, refreshHeaderCustomSuccess. Otherwise, the default refresh header will be used.1.0.0
refreshHeaderCustomTextEnableBooleanNoWhether to display custom refresh header text. Only effective when custom refresh header is enabled.1.0.0
refreshHeaderCustomLoadingGifStringNoCustom loading animation for the refresh header. Must be in gif format and loop continuously. Only supports images within the mini-program package. Only effective when custom refresh header is enabled.1.0.0
refreshHeaderCustomSuccessGifStringNoCustom success animation for the refresh header. Must be in gif format and play only once. Only supports images within the mini-program package. Only effective when custom refresh header is enabled.1.0.0
refreshHeaderCustomLoadingStringNoCustom static loading image for the refresh header. Only supports images within the mini-program package. Only effective when custom refresh header is enabled.1.0.0
refreshHeaderCustomSuccessStringNoCustom static success image for the refresh header. Only supports images within the mini-program package. Only effective when custom refresh header is enabled.1.0.0
refreshHeaderTranslationContentBooleanNotrueWhether to enable content view drag effect. When the content view is transparent with a disabled drag effect, the Header refresh starts to display with an offset equal to the status bar height.1.0.0
refreshHeaderAccentColorHexColorNoText color of the refresh header. Effective when refresh component is enabled, e.g., #000000.1.0.0
refreshHeaderBackgroundColorHexColorNoBackground color of the refresh header. Effective when refresh component is enabled, e.g., #000000.1.0.0
refreshHeaderDelayedNumberNoTimeout to stop the pull-down refresh, disabled by default. Takes effect when greater than 0, in milliseconds.1.0.0
refreshFooterAccentColorHexColorNoText color of the refresh footer. Effective when refresh component is enabled, e.g., #000000.1.0.0
refreshFooterBackgroundColorHexColorNoBackground color of the refresh footer. Effective when refresh component is enabled, e.g., #000000.1.0.0
refreshFooterDelayedNumberNoTimeout to stop the pull-up refresh, disabled by default. Takes effect when greater than 0, in milliseconds.1.0.0
contentBackgroundColorHexColorNoBackground color of the main content view, e.g., #000000.1.0.0
enablePageLoadingBooleanNofalsePage transition loading indicator.1.0.0
enableTabBarAdjustPanBooleanNofalseFor pages with TabBars and input fields, supports preventing the TabBar from being pushed up by the keyboard.4.1.0
darkModeNavigationBarBackgroundColorHexColorNoDark mode navigation bar and status bar background color, e.g., #00000000.6.0.0
darkModeNavigationBarTextStyleStringNoDark mode navigation bar and status bar text color, supports black / white only.6.0.0
darkModeNavigationBarIconStyleStringNoDark mode navigation bar icon color type, supports black / white only.6.0.0
darkModeContentBackgroundColorHexColorNoDark mode main page background color, e.g., #000000.6.0.0
  • Note 1: HexColor (hexadecimal color value), e.g., "#ff00ff"

Supported Values for navigationBarHomeAction

Supported ValuesDescriptionMinimum Version
homeHome button with a small house icon. Tapping it returns to the main page.1.0.0
backBack button with a left arrow icon. Tapping it goes back one level.1.0.0
allDisplays both the home and back buttons.1.0.0

Supported Values for navigationStyle

Supported ValuesDescriptionMinimum Version
defaultDefault style.1.0.0
hideHides the navigation bar, leaving only the capsule button. (In this mode, navigationBarTextStyle and navigationBarIconStyle do not work, including their corresponding API calls.)3.0.0
customCustom navigation bar (Only in this mode, enableTransparentStatusBar, navigationBarBackgroundColor, navigationBarTextStyle, navigationBarIconStylenavigationBarHomeAction can take effect, including their corresponding API calls.)1.0.0

Page Configuration Example

{
"enablePullDownRefresh": false,
"enablePullUpRefresh": false,
"enableAddScreen": true,
"navigationStyle": "custom",
"navigationBarTitleText": "MiniApp Official Demo",
"navigationBarBackgroundColor": "#FFFFFF",
"navigationBarTextStyle": "black",
"navigationBarIconStyle": "black",
"navigationBarHomeAction": "back",
"darkModeNavigationBarBackgroundColor": "#000000",
"darkModeNavigationBarTextStyle": "white",
"darkModeNavigationBarIconStyle": "white",
"darkModeContentBackgroundColor": "#000000"
}
Privacy agreementDeveloper agreementcontact us: developer_service.mi@transsion.com © 2024 MiniApp. All Rights Reserved.