Giter VIP home page Giter VIP logo

react-simple-badges's Introduction

react-simple-badges

React badges for your Profile and Projects.

Find a complete list of over 1400 badges in badges.md

NPM

Install

npm i react-simple-badges
yarn add react-simple-badges

What is this Component?

A Component that renders an image of a badge from shields.io using simpleicons.org list of icons. shields.io doesn't store the primary accent colour of the icon though, simple icons does in a json file. but downloading the whole file (~40kb gziped) is bad for the loading times of a website. so the json file is stored in a firebase function which the component sends a request too with the name of the badge your trying to display. A github action is run every 24 hours checking if the list has been updated and will automatically update the firebase function with the new badges and be published to firebase. Any props passed to the component get passed along to the img element in it so things like style can be applied easily.

Usage

import React from 'react'

import Badge from 'react-simple-badges'

const App = () => {
  return (
    <>
      <Badge name="node.js" style={{width: 200}} logoColor="#eb4034" />
      <Badge name="YouTube Gaming" label="Youtube" />
      <Badge name="Valve" label="Steamy Boi" style={{padding: 10}} />
      <Badge name="Tesla" backgroundColor="#32a853" />
    </>
  )
}

export default App

rendered jsx

Example project on stackblitz.com

props for <Badge />

<Badge name="" /> required : string

The name of the badge your trying to use eg. "Instagram"

<Badge label="" /> optional : string

A custom string to replace the word on the badge eg. "Insta"

<Badge logoColor="" /> optional : string : hex color

Replaces the color of the logo that default to white eg. "#ffb900"

<Badge backgroundColor="" /> optional : string : hex color

Replaces the color of the background of the badge eg. "#00e1ff"

most popular badges

most popular badges graph

react-simple-badges's People

Contributors

nwylynko avatar

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.