Coder Social home page Coder Social logo

intern0t / react-weather-icons Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 2.57 MB

A component library for weather icons by @erikflowers

License: GNU General Public License v3.0

HTML 0.09% JavaScript 99.31% CSS 0.10% Python 0.50%
react-components reactjs weather-icons component-library

react-weather-icons's Introduction

react-weather-icons

A React component library for weather icons by @erikflowers.

NPM JavaScript Style Guide Build Status

Weather Icons Black

View more color play Samples & Color play, reference Icon components here.


Install

npm i @intern0t/react-weather-icons --save

Import

import * as Icons from "@intern0t/react-weather-icons";
import { NightCloudyGusts } from "@intern0t/react-weather-icons";

Usage

<Icons.NightCloudyGusts color="#000" size={30} />
<NightCloudyGusts color="#000" size={30} />

The size defaults to 30 if no size arguments are provided, and color defaults to #000000.


Automation for weather information fetching

All the icons are capitalized and trimmed of all non-alphanumeric characters; hence, you may reverse the process to associate the response from various weather APIs to the icons in this library.

To associate the icons to the response from various weather API providers such as Open Weather Map, World Meteorological Organization, Weather Underground, Forecast.io, and Yahoo. First, you need to have a specific reference list implemented to your application.

Then, replace - in the associated value with space ( ) and capitalize all the words, then replace the spaces ( ) with nothing "". This ends up generating a variable associated with the icon which you can use.

Example

If the request to Open Weather Map's API returned icon id of 310 (wi-owm-day-310), then the value associated would be day-rain, replace all the - with to have day rain and capitalize all the words in the string. In Day Rain, replace all the spaces with nothing "" to achieve DayRain, which is an icon name.


Acknowledgments

License

GPL © intern0t

react-weather-icons's People

Contributors

intern0t avatar

Stargazers

 avatar

Watchers

 avatar  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.