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 🙏

© 2024 – Pkg Stats / Ryan Hefner

azir-badge

v1.0.1

Published

An advance badge component that should render nicely on any platform. Supports a great level of customization.

Downloads

17

Readme

Azir Framwork : https://azir.io/docs

Badge

Please make sure you have azir-theme version 1.0.5 or above ;) .

Badges are small components typically used to communicate a numerical value or indicate the status of an item to the user.

Installation

to install the latest version of azir-badge you only need to run:

npm install azir-badge  --save

or

yarn add azir-badge

Examples

Basic :

import Badge from "azir-badge";
import Avatar from "azir-avatar";
---
<Badge
  badgeContent="+99"
  color="warning"
  badgePosition="tl"
  size="xsmall"
  rounded={true}
  contentSize="large"
  contentRounded={true}
  onPress={() => {
    console.log("hi");
  }}>
  <Avatar size="large" rounded={true}
  source={ { uri: "https://images.unsplash.com/photo-1527980965255-d3b416303d12?ixid=eyJhcHBfaWQiOjEyMDd9" } } />
</Badge>

Badge with Icon :

import Badge from "azir-badge";
import  Icon,{ SolidIcons } from "azir-icon";
---
<Badge
    containerStyle={ { marginTop: 20 } }
    rounded={true}
    badgeContent="12"
    contentSize={50}
    contentRounded={true}
    badgePosition="tr"
    color="warning"
    size="xxsmall"
    textStyle={ { color: "white" } }
    onPress={() => {
      console.log("hi");
    }}
  >
  <Icon icon={SolidIcons.cartPlus}></Icon>
</Badge>

Icon Badge :

import Badge from "azir-badge";
import Avatar from "azir-avatar";
import  Icon,{ SolidIcons } from "azir-icon";
---
<Badge
  containerStyle={ { marginTop: 20 } }
  rounded={false}
  badgeContent={<Icon size={10} color="white"></Icon>}
  contentSize="small"
  contentRounded={false}
  badgePosition="tl"
  badgeStyle={ { top: 25 } }
  color="error"
  size="xxsmall"
  onPress={() => {
    console.log("hi");
  } }>
  <Avatar size="small" rounded={false}
  source={ { uri: "https://images.unsplash.com/photo-1527980965255-d3b416303d12?ixid=eyJhcHBfaWQiOjEyMDd9" } } />
</Badge>

Props


Reference

badgeContent

Badge content.

| Type | Required | Default | | ------------------- | -------- | ------- | | String, JSX element | No | null |

onPress

Handler to be called when the user taps the badge

| Type | Required | | -------- | -------- | | function | Yes |

color

Background Color of the badge

| Type | Required | Default | | ------------------------------------------ | -------- | ------- | | azir-color | No | theme |

size

set the badge component Size.

| Type | Required | Default | | ------------------------------------ | -------- | --------------------------------- | | azir-size | No | Empty content : 22 , Content : 30 |

badgePosition

Badge Position based on its content. tl= top left, tr = top right, bl = bottom left, br = bottom right

| Type | Required | Default | | ------------------------- | -------- | ------- | | "tl" , "tr" , "bl" , "br" | No | tl |

rounded

Makes the Badge circular or square

| Type | Required | Default | | ------- | -------- | ------- | | boolean | No | true |

contentSize

set the badge content Size ( its very important prop with also contentRounded to exactly draw the badge related to the content).

should match the child size

| Type | Required | Default | | ------------------------------------ | -------- | ------- | | azir-size | No | null |

contentRounded

if you have a rounded child then you need to set the prop to true to exactly draw the badge in the right position.

| Type | Required | Default | | ------- | -------- | ------- | | boolean | No | false |

shadow

If true, show shadow effect for this component.

| Type | Required | Default | | ---- | -------- | ------- | | bool | No | false |

containerStyle

override Badge main Container Style

| Type | Required | | ----- | -------- | | style | No |

badgeStyle

override Badge Style in case you want to change the badge position

| Type | Required | | ----- | -------- | | style | No |

style

override Badge container style

| Type | Required | | ----- | -------- | | style | No |

textStyle

override Badge Text Style in case you bas the content as string

| Type | Required | | ----- | -------- | | style | No |