npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@nstudio/nativescript-toolbar

v1.0.0

Published

iOS Toolbar component for NativeScript

Readme

@nstudio/nativescript-toolbar

iOS UIToolbar with first-class UIBarButtonItem and UIToolbarAppearance support.

npm install @nstudio/nativescript-toolbar

Platform Support

  • iOS: fully implemented (UIToolbar)
  • Android: no-op placeholder (toolbar is a native iOS component, but Android users can still install the plugin without errors)

Usage

NativeScript Core (programmatic)

import { Color, EventData, Page } from '@nativescript/core';
import {
  NToolbar,
  ToolbarItemTapEventData,
  ToolbarItem,
} from '@nstudio/nativescript-toolbar';

export function navigatingTo(args: EventData) {
  const page = args.object as Page;

  const toolbar = new NToolbar();
  toolbar.height = 44;
  toolbar.barStyle = 'default';
  toolbar.translucent = true;
  toolbar.tintColor = new Color('#2563eb');

  const items: ToolbarItem[] = [
    { systemItem: 'add', onTap: () => console.log('Add') },
    { systemItem: 'flexibleSpace' },
    { title: 'Edit', style: 'plain', onTap: () => console.log('Edit') },
    { systemItem: 'fixedSpace', width: 8 },
    { systemImage: 'gearshape', onTap: () => console.log('Settings') },
  ];

  toolbar.setItems(items, true);

  toolbar.on(
    NToolbar.itemTapEvent,
    (event: ToolbarItemTapEventData) => {
      console.log('Tapped index:', event.data.index);
      console.log('Tapped descriptor id:', event.data.item.id);
    }
  );

  page.content = toolbar;
}

Angular registration

import { registerElement } from '@nativescript/angular';
import { NToolbar } from '@nstudio/nativescript-toolbar';

registerElement('NToolbar', () => NToolbar);

Angular usage

<!-- any Angular component template -->
<NToolbar
  #toolbar
  height="44"
  barStyle="default"
  translucent="true"
  tintColor="#2563eb"
  (loaded)="onToolbarLoaded($event)"
  (itemTap)="onToolbarTap($event)">
</NToolbar>
import { Component } from '@angular/core';
import { EventData } from '@nativescript/core';
import { NToolbar, ToolbarItem, ToolbarItemTapEventData } from '@nstudio/nativescript-toolbar';

@Component({
  selector: 'demo-toolbar',
  templateUrl: './demo-toolbar.component.html',
})
export class DemoToolbarComponent {
  onToolbarLoaded(args: EventData) {
    const toolbar = args.object as NToolbar;
    const items: ToolbarItem[] = [
      { id: 'compose', systemItem: 'compose' },
      { systemItem: 'flexibleSpace' },
      { id: 'publish', title: 'Publish', style: 'done' },
      { systemItem: 'fixedSpace', width: 8 },
      { id: 'filters', systemImage: 'slider.horizontal.3' },
    ];
    toolbar.setItems(items, true);
  }

  onToolbarTap(args: ToolbarItemTapEventData) {
    console.log('Tapped:', args.data.item?.id ?? args.data.index);
  }
}

React registration

import { registerElement } from 'react-nativescript';
import { NToolbar } from '@nstudio/nativescript-toolbar';

registerElement('nToolbar', () => NToolbar);

Solid registration

import { registerElement } from 'dominative';
import { NToolbar } from '@nstudio/nativescript-toolbar';

registerElement('nToolbar', NToolbar);

Svelte registration

import { registerNativeViewElement } from '@nativescript-community/svelte-native/dom';
import { NToolbar } from '@nstudio/nativescript-toolbar';

registerNativeViewElement('nToolbar', () => NToolbar);

Vue registration

import { registerElement } from 'nativescript-vue';
import { NToolbar } from '@nstudio/nativescript-toolbar';

registerElement('NToolbar', () => NToolbar);

API

Class

NToolbar extends View.

Properties

  • items: ToolbarItem[]
  • barStyle: 'default' | 'black' | 'blackOpaque' | 'blackTranslucent' | number
  • translucent: boolean
  • barTintColor: string | Color | UIColor
  • tintColor: string | Color | UIColor
  • position: 'any' | 'bottom' | 'top' | 'topAttached' | number
  • defaultMetrics: 'default' | 'compact' | 'defaultPrompt' | 'compactPrompt' | 'landscapePhone' | 'landscapePhonePrompt' | number
  • itemChangesAnimated: boolean
  • standardAppearance: ToolbarAppearance (iOS 13+)
  • compactAppearance: ToolbarAppearance (iOS 13+)
  • scrollEdgeAppearance: ToolbarAppearance (iOS 15+)
  • compactScrollEdgeAppearance: ToolbarAppearance (iOS 15+)

Events

  • itemTap: raised when a descriptor-backed tappable item is pressed (ToolbarItemTapEventData)

Methods

  • setItems(items: ToolbarItem[], animated?: boolean): void
  • getNativeItems(): UIBarButtonItem[]
  • getNativeItem(indexOrId: number | string): UIBarButtonItem | null
  • setAppearance(slot: 'standard' | 'compact' | 'scrollEdge' | 'compactScrollEdge', appearance: ToolbarAppearance): void
  • setBackgroundImage(image, position?, metrics?): void
  • getBackgroundImage(position?, metrics?): UIImage | null
  • clearBackgroundImage(position?, metrics?): void
  • setShadowImage(image, position?): void
  • getShadowImage(position?): UIImage | null
  • clearShadowImage(position?): void

ToolbarItem

ToolbarItem supports native and high-level item creation:

type ToolbarItem = {
  id?: number | string;
  nativeItem?: UIBarButtonItem; // escape hatch: pass fully native item

  systemItem?: ToolbarSystemItem; // done, add, flexibleSpace, fixedSpace, etc.
  title?: string;
  style?: 'plain' | 'bordered' | 'done' | 'prominent' | number;
  image?: string | ImageSource | UIImage; // supports sys:// (sf:// and symbol:// aliases also supported)
  systemImage?: string; // SF Symbol name
  landscapeImagePhone?: string | ImageSource | UIImage;
  customView?: View | UIView | (() => View | UIView);

  width?: number;
  enabled?: boolean;
  tintColor?: string | Color | UIColor;
  tag?: number;
  accessibilityIdentifier?: string;

  // iOS 14+ menu/action support
  menu?: UIMenu;
  primaryAction?: UIAction;

  // iOS 15+/16+/17+ optional flags
  changesSelectionAsPrimaryAction?: boolean;
  selected?: boolean;
  hidden?: boolean;
  springLoaded?: boolean;
  symbolAnimationEnabled?: boolean;

  onTap?: (args: ToolbarItemTapEventData) => void;
}

ToolbarSystemItem supports:

  • done, cancel, edit, save, add
  • flexibleSpace, fixedSpace
  • compose, reply, action, organize, bookmarks
  • search, refresh, stop, camera, trash
  • play, pause, rewind, fastForward
  • undo, redo, pageCurl, close, writingTools

Appearance API (UIToolbarAppearance, iOS 13+)

toolbar.standardAppearance = {
  preset: 'opaque',
  backgroundColor: '#ffffff',
  shadowColor: '#e5e7eb',
  buttonAppearance: {
    normal: {
      titleTextAttributes: {
        foregroundColor: '#111827',
      },
    },
    highlighted: {
      titleTextAttributes: {
        foregroundColor: '#2563eb',
      },
    },
  },
};

toolbar.scrollEdgeAppearance = {
  preset: 'transparent',
  backgroundEffectStyle: 'systemThinMaterial',
};

ToolbarAppearance options:

  • preset: 'default' | 'opaque' | 'transparent'
  • backgroundColor
  • backgroundEffectStyle (UIBlurEffectStyle name or numeric value)
  • backgroundImage
  • backgroundImageContentMode
  • shadowColor
  • shadowImage
  • buttonAppearance
  • doneButtonAppearance
  • prominentButtonAppearance (if available on the OS/runtime)

Native Escape Hatch

For any unsupported edge case, create UIBarButtonItem yourself and pass it via ToolbarItem.nativeItem. The plugin will still place it in the toolbar and keep getNativeItems()/getNativeItem() in sync.

License

Apache License Version 2.0