Skip to content
This repository has been archived by the owner on Mar 31, 2023. It is now read-only.

Latest commit

 

History

History
45 lines (34 loc) · 1.25 KB

README.md

File metadata and controls

45 lines (34 loc) · 1.25 KB

simple-react-weather

Very basic weather applet for React with icons from react-icons-weather
Demo available here

NPM JavaScript Style Guide

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