npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

react-islamic-prayer-times

v2.1.3

Published

A React component library for Islamic prayer times

Downloads

1,700

Readme

About The Project

A modern React component for displaying Islamic prayer times with support for both horizontal and vertical layouts.

Horizontal Layout

Horizontal Layout

Vertical Layout

Vertical Layout

Features

  • 🎨 Multiple display options: Horizontal, Vertical, and Minimized
  • 🎯 Next prayer time focus mode
  • 🌍 Automatic location detection
  • ⚡ Real-time updates
  • 🎯 Precise prayer times using Aladhan API
  • 🔄 Automatic timezone handling
  • 📱 Responsive design
  • ♿ Accessibility support
  • 💅 Customizable styling
  • 🕌 Optional Jumu'ah prayer display
  • ☀️ Optional Sunrise time display
  • ⚙️ Configurable calculation methods
  • 🎭 Multiple madhab options

Installation

npm install react-prayer-times
# or
yarn add react-prayer-times

Usage

Basic Usage

import PrayerTimesDisplay from "react-prayer-times";

// Horizontal Layout (default)
function App() {
  return <PrayerTimesDisplay />;
}

// Vertical Layout
function App() {
  return <PrayerTimesDisplay layout="vertical" />;
}

// Minimized View (only next prayer)
function App() {
  return <PrayerTimesDisplay showNextOnly={true} />;
}

With Custom Location

<PrayerTimesDisplay
  location={{
    city: "London",
    country: "UK",
    method: 2, // ISNA method
    school: 0, // Shafi school
  }}
/>

Display Options

// Minimized view with only the next prayer
<PrayerTimesDisplay
  minimized={true}
  showNextOnly={true}
/>

// Full view with only the next prayer
<PrayerTimesDisplay showNextOnly={true} />

// Minimized view with all prayers
<PrayerTimesDisplay minimized={true} />

With Custom Styles

<PrayerTimesDisplay
  styles={{
    container: {
      backgroundColor: "#f8f9fa",
      borderRadius: "12px",
      padding: "20px",
    },
    timeBlock: {
      backgroundColor: "#e9ecef",
      borderRadius: "8px",
    },
    time: {
      color: "#2c3e50",
      fontWeight: "bold",
    },
  }}
/>

With All Options

<PrayerTimesDisplay
  minimized={false}
  showNextOnly={false}
  showSettings={true}
  showJumuah={true}
  showSunrise={true}
  styles={{
    container: { backgroundColor: "#f8f9fa" },
    header: { backgroundColor: "#f0f0f0" },
    timeBlockContainer: { padding: "20px", gap: "2rem" },
    timeBlock: { backgroundColor: "#fff" },
    time: { color: "#333", fontWeight: "bold" },
    title: { color: "#000" }
  }}
  location={{
    city: "London",
    country: "UK",
    method: 2, // ISNA
    school: 0  // Shafi
  }}
/>

Props

| Prop | Type | Default | Description | | -------------- | ------------------------------ | -------------- | ------------------------- | | minimized | boolean | false | Enable minimized view | | showNextOnly | boolean | false | Show only the next prayer | | styles | object | {} | Custom styles | | location | object | {} | Location config | | showSettings | boolean | false | Show settings panel | | showJumuah | boolean | false | Show Jumu'ah prayer on Fridays | | showSunrise | boolean | false | Show Sunrise time | | styles.timeBlockContainer | object | {} | Styles for the prayer times grid container |

Location Configuration

interface LocationConfig {
  address?: string;
  city?: string;
  country?: string;
  state?: string;
  school?: number; // 0: Shafi, 1: Hanafi
  method?: number; // Calculation method (0-23)
}

Compatibility

Supports React versions 16.8.0 through 19.x.x

Built With

License

MIT © [Your Name]

Acknowledgments