2.1.3 โ€ข Published 12 months ago

react-islamic-prayer-times v2.1.3

Weekly downloads
-
License
MIT
Repository
-
Last release
12 months ago

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

PropTypeDefaultDescription
minimizedbooleanfalseEnable minimized view
showNextOnlybooleanfalseShow only the next prayer
stylesobject{}Custom styles
locationobject{}Location config
showSettingsbooleanfalseShow settings panel
showJumuahbooleanfalseShow Jumu'ah prayer on Fridays
showSunrisebooleanfalseShow Sunrise time
styles.timeBlockContainerobject{}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

2.1.3

12 months ago

2.1.2

12 months ago

2.1.1

12 months ago

2.1.0

12 months ago

2.0.1

12 months ago

2.0.0

12 months ago

3.0.0

12 months ago

1.0.27

12 months ago

1.0.26

12 months ago

1.0.25

12 months ago

1.0.24

12 months ago

1.0.23

12 months ago

1.0.22

12 months ago

1.0.21

12 months ago

1.0.20

12 months ago

1.0.19

12 months ago

1.0.18

12 months ago

1.0.17

12 months ago

1.0.16

12 months ago

1.0.15

12 months ago

1.0.13

12 months ago

1.0.12

12 months ago

1.0.11

12 months ago

1.0.10

12 months ago

1.0.9

12 months ago

1.0.8

12 months ago

1.0.5

12 months ago

1.0.4

12 months ago

1.0.3

12 months ago

1.0.2

12 months ago

1.0.1

12 months ago

1.0.0

12 months ago