![require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages](https://cdn.sanity.io/images/cgdhsj6q/production/be8ab80c8efa5907bc341c6fefe9aa20d239d890-1600x1097.png?w=400&fit=max&auto=format)
Security News
require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
nativescript-bottombar
Advanced tools
NativeScript plugin for AHBottomNavigation and MiniTabBar
The documentation will be updated asap, a lot of brend new features on top of the iOS support
:beers: :smile:
NS 3.0 Support coming with the v3.0 of nativescript-bottombar package
tns plugin add nativescript-bottombar
IMPORTANT: Make sure you include xmlns:btn:"nativescript-bottombar"
on the Page element
...
xmlns:btn="nativescript-bottombar"
...
<btn:BottomBar tabSelected="tabSelected" titleState="{{ titleStateValue }}" hide="{{ hidden}}" >
<btn:BottomBar.items>
<btn:BottomBarItem title="Cake" icon="ic_cake_white_24dp" color="#4CAF50" />
<btn:BottomBarItem title="Favorites" icon="ic_favorite_white_24dp" color="#2196F3" />
<btn:BottomBarItem title="Settings" icon="ic_settings_white_24dp" color="#FF4081" />
</btn:BottomBar.items>
</btn:BottomBar>
export function pageLoaded(args: EventData) {
// Get the event sender
page = <Page>args.object;
page.bindingContext = new HelloWorldModel();
}
export function tabSelected(args) {
console.log(args.eventName + ' ' + args.oldIndex + ' ' + args.newIndex)
page.bindingContext.set('message', `Tab ${args.newIndex} selected`)
}
import {Observable} from 'data/observable';
import {TITLE_STATE} from 'nativescript-bottombar/bottombar.common';
export class HelloWorldModel extends Observable {
public message: string;
public titleStateValue: TITLE_STATE
public hidden: boolean;
constructor() {
super();
this.titleStateValue = TITLE_STATE.SHOW_WHEN_ACTIVE;
this.hidden = false;
}
}
!!! If you want to change items color, title.. you'll have to wait for the BottomBar to be loaded !!!
<GridLayout rows="*, auto">
<Label row="0" text="test"></Label>
<GridLayout row="1">
<BottomBar row="1" [items]="items" (tabSelected)="tabSelected($event)" [hide]="hidden" titleState="{{titleState}}" (loaded)="bottomBarLoaded()"></BottomBar>
</GridLayout>
</GridLayout>
import { Component } from "@angular/core";
import { registerElement } from 'nativescript-angular';
import { BottomBar, BottomBarItem, TITLE_STATE, SelectedIndexChangedEventData } from 'nativescript-bottombar';
registerElement('BottomBar', () => BottomBar);
@Component({
selector: "ns-app",
templateUrl: "app.component.html",
})
export class AppComponent {
public selectedIndex: number;
public hidden: boolean;
public titleState: TITLE_STATE;
public items: Array<BottomBarItem> = [
new BottomBarItem(0, "Home", "ic_home_black_24dp", "black", "lol"),
new BottomBarItem(1, "Calendar", "ic_calendar", "#1083BF", "mdr"),
new BottomBarItem(2, "Profile", "ic_collaborator", "pink", "lmao"),
new BottomBarItem(3, "Message", "ic_paperplane", "green", "xD")
];
constructor() {
this.selectedIndex = 0;
this.hidden = false;
this.titleState = TITLE_STATE.SHOW_WHEN_ACTIVE;
}
tabSelected(args: SelectedIndexChangedEventData) {
if (args.newIndex !== args.oldIndex) {
console.log(args.newIndex);
this.selectedIndex = args.newIndex;
this.items[this.selectedIndex].notification = "1";
}
}
bottomBarLoaded() {
console.log('bottomBarLoaded');
}
}
Don't forget that you need your icons files to be in your ressources folder as follow:
FAQs
NativeScript plugin for AHBottomNavigation.
We found that nativescript-bottombar demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
Security News
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.