Socket
Book a DemoInstallSign in
Socket

nativescript-badge-button

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nativescript-badge-button

NativeScript plugin for badges inside of buttons.

latest
Source
npmnpm
Version
0.1.2
Version published
Maintainers
1
Created
Source

NativeScript Badge Button Plugin

npm npm

Creates a native UIButton with a badge component. Currently only supported on iOS.

Getting Started

  • npm install nativescript-badge-button --save
  • Add the BadgeButton element to your Page tag:
xmlns:BadgeButton="nativescript-badge-button"
  • Use the element on your page:
<BadgeButton:BadgeButton text="Button with Badge" badgeValue="1" badgeOriginX="450" />

Available Properties

PropertyTypeDefault
badgeBGColorUIColorredColor
badgeTextColorUIColorwhiteColor
badgeFontUIFontsystemFontOfSize:12.0
badgePaddingnumber6
badgeMinSizenumber8
badgeOriginXnumber0
badgeOriginYnumber-4
shouldHideBadgeAtZerobooleantrue
shouldAnimateBadgebooleantrue

Demo

  • Note: Incremental badge is animated, but recording tool can only capture 4 fps. Image

Known Issues

  • Positioning of the badge is incorrect when rotating the device
  • OriginX of the badge does not auto calculate based on the button text

Credits

Keywords

NativeScript

FAQs

Package last updated on 28 Sep 2017

Did you know?

Socket

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.

Install

Related posts