Coder Social home page Coder Social logo

reactweather's Introduction

Alt text

ReactWeather

npm license

Minimalistic react weather component.

Features

  • Beautiful Widgets
  • Minimal Design
  • Supports openweathermap API
  • Extendable to more external API'S
  • Simple & Minimal API.

Installing

Install via npm:

npm install react-weather --save

Quick Example

This example shows how to use the GenericWeather component. The component display static data via props.

import ReactDOM from 'react-dom';
import { GenericWeather } from 'react-weather';


ReactDOM.render(
  <GenericWeather city="Jerusalem" temp=17.61 status="sun" />,
  document.getElementById('root')
)

Example using Openweathermap api

https://openweathermap.org/api - Get real time weather via Openweathermap api.

import ReactDOM from 'react-dom';
import { OpenWeatherMap } from 'react-weather';


ReactDOM.render(
  <OpenWeatherMap city="Jerusalem" country="IL" appid="your-api-key" />,
  document.getElementById('root')
)

ReactWeather API

GenericWeather

The basic component is GenericWeather. this component is the main component, all the other components use it.

<GenericWeather />

props:

  • city - The city name
  • temp - the temperature
  • status - the icon to show - meanwhile it's just sun / rain
OpenWeatherMap

This component use the openweathermap api to get weather data. the component fetch using axios data from the api, and render the GenericWeather for you.

<OpenWeatherMap />

props:

  • city - The city name - required
  • country - The country code - not required
  • appid - The api key from openweathermap - required
  • units - The units of the temperature - metric / imperial - not required, default is metric

Credits

ReactWeather is inspired by Soumya Ranjan Bishi credits to Alberto Jerez about the sass code

License

MIT

reactweather's People

Contributors

p-fernandez avatar amarshaked avatar

Watchers

James Cloos avatar Jorge Martinez 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.