simple-react-weather
v1.0.2
Published
Very basic weather applet for React with icons
Downloads
19
Maintainers
Readme
simple-react-weather
Very basic weather applet for React with icons from react-icons-weather
Demo available here
Install
npm install --save simple-react-weather
Usage
import React, { Component } from 'react'
import Weather from 'simple-react-weather'
class Example extends Component {
render () {
return (
//With city name provided
<Weather unit="C" city="CITY" appid="YOUR APPID FROM OWM" />
//Based on latitude and longitude
<Weather unit="C" lat="" lon="" appid="YOUR APPID FROM OWM" />
)
}
}
Props
unit: String
C for Celcius, F for Fahrenheit
lat/lon: Number
Latitude and longitude, can be acquired from navigator.geolocation.getCurrentPosition()
city: String
appid: String
Your AppId from OWM
You can also use all other custom props like onClick, id etc.
License
GNU GPLv3 © iruszpel