2.0.0 • Published 1 year ago

@feinzer/capacitor-navigation-bar v2.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

Maintainers

MaintainerGitHubSocial
Hugo Tomazihugotomazi@hugotomazi

Install

npm install @hugotomazi/capacitor-navigation-bar
npx cap sync

Configuration

No configuration required for this plugin.

API

show()

show() => Promise<void>

Display the navigation bar.


hide()

hide() => Promise<void>

Hide the navigation bar.


setColor(...)

setColor(options: ColorParameters) => Promise<void>

Change the color of the navigation bar. *Support alpha hexadecimal numbers.

ParamType
optionsColorParameters

setTransparency(...)

setTransparency(options: { isTransparent: boolean; }) => Promise<void>

Set the Transparency

ParamType
options{ isTransparent: boolean; }

getColor()

getColor() => Promise<{ color: string; }>

Gets the current color of the navigation bar in Hexadecimal.

Returns: Promise<{ color: string; }>


addListener(NavigationBarPluginEvents.SHOW, ...)

addListener(event: NavigationBarPluginEvents.SHOW, listenerFunc: () => void) => PluginListenerHandle

Event fired after navigation bar is displayed

ParamTypeDescription
eventNavigationBarPluginEvents.SHOWThe event
listenerFunc() => voidCallback

Returns: PluginListenerHandle


addListener(NavigationBarPluginEvents.HIDE, ...)

addListener(event: NavigationBarPluginEvents.HIDE, listenerFunc: () => void) => PluginListenerHandle

Event fired after navigation bar is hidden

ParamTypeDescription
eventNavigationBarPluginEvents.HIDEThe event
listenerFunc() => voidCallback

Returns: PluginListenerHandle


addListener(NavigationBarPluginEvents.COLOR_CHANGE, ...)

addListener(event: NavigationBarPluginEvents.COLOR_CHANGE, listenerFunc: (returnObject: { color: string; }) => void) => PluginListenerHandle

Event fired after navigation bar color is changed

ParamTypeDescription
eventNavigationBarPluginEvents.COLOR_CHANGEThe event
listenerFunc(returnObject: { color: string; }) => voidCallback

Returns: PluginListenerHandle


Interfaces

ColorParameters

PropTypeDescription
colorstringSets the new color of the navigation bar.
darkButtonsbooleanSets whether the default navigation bar buttons should be black or white.

PluginListenerHandle

PropType
remove() => Promise<void>

Enums

NavigationBarPluginEvents

MembersValueDescription
SHOW'onShow'Called after the navigation bar is displayed
HIDE'onHide'Called after navigation bar is hidden
COLOR_CHANGE'onColorChange'Called after navigation bar color is changed