0.0.5 • Published 3 years ago

@alyrik/react-city-weather-report-widget v0.0.5

Weekly downloads
-
License
ISC
Repository
github
Last release
3 years ago

React City Weather Report Widget

A simple React component showing current weather for given location.

It uses OpenWeather API to load weather data.

Check out live DEMO.

Prerequisites

You are required to provide your own OpenWeather API key in order to make the widget work. You can obtain API key for free by creating an account on OpenWeather website.

Installation

npm install --save @alyrik/react-city-weather-report-widget

Usage

Just place <ReactCityWeatherReportWidget> component anywhere in your app:

import { ReactCityWeatherReportWidget } from '@alyrik/react-city-weather-report-widget';

function App() {
  return (
    <main>
      <ReactCityWeatherReportWidget
        apiKey="..."
        defaultCity="..."
      </<ReactCityWeatherReportWidget>
    </main>
  );
}

Props

PropertyTypeRequiredDefaultDescription
apiKeyStringtrue---OpenWeather API key
defaultCityStringtrue---Name of the city to be shown by default
refetchIntervalNumberfalse30000Interval in ms for refetching current weather data. ⚠️ Don't make it less than 1000ms if you use free subscription otherwise it will abuse free limits and your API token will be temporarily blocked
orientation'vertical''horizontal'false'vertical'Widget orientation

Development

  • Clone this repo.
  • npm install
  • npm run storybook

Building

npm install
npm run build
0.0.5

3 years ago

0.0.4

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago