Skip to main content

initNavbar

Description

Initialize navbar for fullscreen apps

Parameters

ParameterData TypeRequiredDescription
onClickBack() => voidYesFunction for navigating back. You can make use of window.history object or useHistory() hook of react-router-dom, depending on your application requirement and context.
showbooleanNoWhether to show the navbar or not. Default is true
titlestringNoTitle of the navbar. Default is "Zalopay"
titleColorstringNoTitle color of the navbar. Default is #fff
titleAlignstringNoTitle alignment of the navbar. Default is start
backgroundColorstringNoBackground color of the navbar. Default is #0033c9
backBtnColorstringNoBack button color of the navbar. Default is #fff

Return Value

N/A

Error Code

N/A

Sample Code and Sample Return Data

Sample Request:

window.zlpSdk.UI.initNavbar({
title: "Test App",
})
.then((response) => console.log(response))
.catch((error) => console.error(error.errorCode));

Sample Response:

{ "data": {}, "status": "success" }