Giter Site home page Giter Site logo

simonox / nativescript-badge-button Goto Github PK

View Code? Open in Web Editor NEW

This project forked from sean-perkins/nativescript-badge-button

1.0 2.0 1.0 1.37 MB

NativeScript plugin for creating a button with a badge label.

License: Other

TypeScript 98.43% Ruby 1.57%

nativescript-badge-button's Introduction

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

nativescript-badge-button's People

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

swahn-lab

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.