Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hugotomazi/navigation-bar
Navigation Bar plugin for Capacitor
https://github.com/hugotomazi/navigation-bar
android capacitor-community capacitor-plugin ionic-framework ionic5 ios navigation-bar web
Last synced: 3 months ago
JSON representation
Navigation Bar plugin for Capacitor
- Host: GitHub
- URL: https://github.com/hugotomazi/navigation-bar
- Owner: hugotomazi
- License: mit
- Created: 2021-08-22T15:32:45.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2024-02-02T23:14:49.000Z (9 months ago)
- Last Synced: 2024-04-28T09:31:44.003Z (6 months ago)
- Topics: android, capacitor-community, capacitor-plugin, ionic-framework, ionic5, ios, navigation-bar, web
- Language: TypeScript
- Homepage:
- Size: 1.1 MB
- Stars: 49
- Watchers: 3
- Forks: 14
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
- awesome-capacitor - Navigation bar - Navigation Bar manipulation, hide/show. (Other plugins)
README
Navigation Bar
@hugotomazi/capacitor-navigation-bar
Capacitor plugin for Navigation Bar manipulation.
## Maintainers
| Maintainer | GitHub | Social |
| ----------- | ------------------------------------------- | --------------------------------------------------------------- |
| Hugo Tomazi | [hugotomazi](https://github.com/hugotomazi) | [@hugotomazi](https://br.linkedin.com/in/hugo-tomazi-299034101) |## Install
```bash
npm install @hugotomazi/capacitor-navigation-bar
npx cap sync
```## Configuration
No configuration required for this plugin.
## API
* [`show()`](#show)
* [`hide()`](#hide)
* [`setColor(...)`](#setcolor)
* [`setTransparency(...)`](#settransparency)
* [`getColor()`](#getcolor)
* [`addListener(...)`](#addlistener)
* [`addListener(...)`](#addlistener)
* [`addListener(...)`](#addlistener)
* [Interfaces](#interfaces)
* [Enums](#enums)### show()
```typescript
show() => Promise
```Display the navigation bar.
--------------------
### hide()
```typescript
hide() => Promise
```Hide the navigation bar.
--------------------
### setColor(...)
```typescript
setColor(options: ColorParameters) => Promise
```Change the color of the navigation bar.
*Support alpha hexadecimal numbers.| Param | Type |
| ------------- | ----------------------------------------------------------- |
| **`options`** |ColorParameters
|--------------------
### setTransparency(...)
```typescript
setTransparency(options: { isTransparent: boolean; }) => Promise
```Set the Transparency
| Param | Type |
| ------------- | ---------------------------------------- |
| **`options`** |{ isTransparent: boolean; }
|--------------------
### getColor()
```typescript
getColor() => Promise<{ color: string; }>
```Gets the current color of the navigation bar in Hexadecimal.
**Returns:**
Promise<{ color: string; }>
--------------------
### addListener(...)
```typescript
addListener(event: NavigationBarPluginEvents.SHOW, listenerFunc: () => void) => Promise
```Event fired after navigation bar is displayed
| Param | Type | Description |
| ------------------ | ------------------------------------------------------------------------------------ | ----------- |
| **`event`** |NavigationBarPluginEvents.SHOW
| The event |
| **`listenerFunc`** |() => void
| Callback |**Returns:**
Promise<PluginListenerHandle>
--------------------
### addListener(...)
```typescript
addListener(event: NavigationBarPluginEvents.HIDE, listenerFunc: () => void) => Promise
```Event fired after navigation bar is hidden
| Param | Type | Description |
| ------------------ | ------------------------------------------------------------------------------------ | ----------- |
| **`event`** |NavigationBarPluginEvents.HIDE
| The event |
| **`listenerFunc`** |() => void
| Callback |**Returns:**
Promise<PluginListenerHandle>
--------------------
### addListener(...)
```typescript
addListener(event: NavigationBarPluginEvents.COLOR_CHANGE, listenerFunc: (returnObject: { color: string; }) => void) => Promise
```Event fired after navigation bar color is changed
| Param | Type | Description |
| ------------------ | -------------------------------------------------------------------------------------------- | ----------- |
| **`event`** |NavigationBarPluginEvents.COLOR_CHANGE
| The event |
| **`listenerFunc`** |(returnObject: { color: string; }) => void
| Callback |**Returns:**
Promise<PluginListenerHandle>
--------------------
### Interfaces
#### ColorParameters
| Prop | Type | Description |
| ----------------- | -------------------- | ------------------------------------------------------------------------- |
| **`color`** |string
| Sets the new color of the navigation bar. |
| **`darkButtons`** |boolean
| Sets whether the default navigation bar buttons should be black or white. |#### PluginListenerHandle
| Prop | Type |
| ------------ | ----------------------------------------- |
| **`remove`** |() => Promise<void>
|### Enums
#### NavigationBarPluginEvents
| Members | Value | Description |
| ------------------ | ---------------------------- | -------------------------------------------- |
| **`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 |