Skip to main content

Prayer Times

A beautiful, RTL-aware component to display Islamic prayer times. Perfect for GCC applications with full bilingual support and multiple layout variants.

Preview

Prayer Times

Riyadh
November 6, 2025
Next Prayer
Dhuhr
2:30:15
Fajr
04:45
Dhuhr
Next
12:15
Asr
15:30
Maghrib
18:05
Isha
19:35

Installation

Copy and paste the component code into your project:

Dependencies: This component uses Card, Badge, and Lucide icons which should already be installed in your project.

Usage

Examples

Default

The default variant with location, date, and next prayer countdown.

Prayer Times

Dubai
November 6, 2025
Next Prayer
Asr
1:45:30
Fajr
04:45
Dhuhr
12:15
Asr
Next
15:30
Maghrib
18:05
Isha
19:35

Compact

A more condensed layout perfect for sidebars or widgets.

Prayer Times

Mecca
Fajr
04:45
Dhuhr
12:15
Asr
15:30
Maghrib
Next
18:05
Isha
19:35

Detailed

A more spacious layout with larger text, ideal for prominent displays.

Prayer Times

Jeddah
November 6, 2025
Next Prayer
Isha
0:45:12
Fajr
04:45
Dhuhr
12:15
Asr
15:30
Maghrib
18:05
Isha
Next
19:35

Without Countdown

Simple display of prayer times without next prayer countdown.

Prayer Times

Doha
November 6, 2025
Fajr
04:45
Dhuhr
12:15
Asr
15:30
Maghrib
18:05
Isha
19:35

Notification Variant

Special UI for Adhan notifications with dismiss and play adhan actions. Perfect for alerts when prayer time arrives.

Prayer Time

Maghrib

Time

18:05

Riyadh

Integration with Calculation Libraries

This component is UI-only and accepts prayer times as props. You can integrate it with any prayer time calculation library. Here's an example using the popular adhan library:

Install the adhan library: npm install adhan

Props

NameTypeDefaultDescription
prayers
Required
Prayer[]Array of prayer objects with name, nameAr, and time properties.
nextPrayer
stringundefinedName of the next prayer to highlight. Should match a prayer name in the prayers array.
countdown
stringundefinedCountdown timer to next prayer in format "HH:MM:SS" or "MM:SS".
location
stringundefinedLocation name in English (e.g., "Riyadh").
locationAr
stringundefinedLocation name in Arabic (e.g., "الرياض").
date
stringundefinedDate in English (e.g., "November 6, 2025").
dateAr
stringundefinedDate in Arabic (e.g., "٥ جمادى الأولى ١٤٤٧").
variant
"default" | "compact" | "detailed" | "notification""default"Visual variant affecting spacing and text size. "notification" shows an Adhan alert UI.
onDismiss
() => voidundefinedCallback when notification is dismissed (notification variant only).
showPlayAdhan
booleanfalseShow play adhan button (notification variant only).
onPlayAdhan
() => voidundefinedCallback when play adhan is clicked (notification variant only).
className
stringundefinedAdditional CSS classes for the wrapper card.

Prayer Type

Accessibility

The Prayer Times component follows accessibility best practices:

  • Semantic HTML: Uses proper heading hierarchy and semantic elements.
  • Visual Indicators: Color dots and borders provide visual cues for the next prayer.
  • High Contrast: Text and icons maintain proper contrast ratios for readability.
  • Tabular Numbers: Uses tabular-nums for consistent time alignment.
  • Responsive Design: Adapts to different screen sizes while maintaining readability.

RTL Considerations

This component is built with RTL-first principles and automatically adapts to the current text direction:

  • Automatic Language Detection: Displays Arabic names (nameAr) in RTL mode and English names in LTR mode.
  • Logical Properties: Uses margin-inline-start (ms-*) and margin-inline-end (me-*) for proper spacing in both directions.
  • Text Alignment: Uses text-start and text-end instead of left/right alignment.
  • Icon Positioning: Icons automatically position correctly in both LTR and RTL layouts.
  • Badge Labels: "Next" badge shows "الآن" (Now) in Arabic mode.

Related Components