Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

Awesome Lists containing this project

README

        



Navigation Bar


@hugotomazi/capacitor-navigation-bar



Capacitor plugin for Navigation Bar manipulation.











Donate with PayPal button






## 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 |