Skip to content
This repository has been archived by the owner. It is now read-only.
NativeScript plugin for creating a button with a badge label.
TypeScript Ruby
Branch: master
Clone or download
Pull request Compare This branch is 2 commits behind sean-perkins:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
demo
platforms/ios
.gitignore
.npmignore
LICENSE
README.md
badgeButton.android.d.ts
badgeButton.android.ts
badgeButton.ios.d.ts
badgeButton.ios.ts
index.d.ts
package.json
tsconfig.json

README.md

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

Property Type Default
badgeBGColor UIColor redColor
badgeTextColor UIColor whiteColor
badgeFont UIFont systemFontOfSize:12.0
badgePadding number 6
badgeMinSize number 8
badgeOriginX number 0
badgeOriginY number -4
shouldHideBadgeAtZero boolean true
shouldAnimateBadge boolean true

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

You can’t perform that action at this time.