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 🙏

© 2026 – Pkg Stats / Ryan Hefner

nepali-calendar-vue

v1.2.1

Published

Customizable Nepali Calendar (नेपाली पात्रो) Vue 3 component and standalone embeddable widget with Bikram Sambat dates, holidays, festivals, tithi, and offline support.

Readme

Nepali Calendar (नेपाली पात्रो) for Vue 3 & Web

Live Demo npm version License: MIT

A customizable, lightweight, and interactive Nepali Calendar (नेपाली पात्रो) Vue 3 component and standalone embeddable widget. Built with Bikram Sambat (BS) date conversion, festivals, tithi, public holidays, event modals, next/previous navigation, offline support, and themes.


🌐 Live Interactive Demo

🚀 Explore the interactive demo hosted at:
👉 https://democalendar.bhujelrajib.com.np

🌟 What's in the Demo:

  • 🖥️ Master Interactive Sandbox: Test all props, themes, numerals (Devanagari vs English), toggles, and date cell inspectors in real time.
  • 📱 Compact Sidebar Widget & Live Event Stream: See the compact widget inside a mock dashboard and inspect @date-click, @month-change, @event-click reactive event payloads live.
  • ⚡ 100% Offline & Custom Events Playground: Test the zero-dependency offline calculation engine and add custom organization/personal holidays dynamically.
  • 🔄 Two-Way BS ⇄ AD Date Converter: Convert dates between Bikram Sambat and Gregorian with full Panchang, seasons, and quick calendar jump.
  • 🎨 Themes & Custom Slots Lab: Live gallery of all 4 built-in themes and scoped slot customization examples (#brand, #cell, #modal).
  • 🛠️ Embed & Code Builder: Generate production-ready copy-paste code snippets for Vue 3 SFC, Vanilla HTML CDN script, Auto-init HTML, and React.

✨ Features

  • 📅 Complete Bikram Sambat (BS) Calendar: Accurately maps Nepali dates, months (बैशाख - चैत), and English Gregorian equivalents.
  • 🎯 Auto-detects Today: Real-time highlighting of today's Nepali date with Devanagari numerals.
  • 🎪 Festivals & Public Holidays: Built-in support for holidays (highlighted in red) and special events/festivals.
  • 📌 Tithi & Event Modals: Click on any date to open an interactive modal with event details, tithi, and a share button.
  • 🔌 Dynamic API & Offline Fallback: Fetches government holidays & events via configurable API (apiUrl), or operates 100% offline (offline) with local date calculations and custom events support!
  • 📱 Compact / Sidebar Widget Mode: Scaled compact view for dashboard widgets, sidebars, or embed cards.
  • 🎨 Multiple Themes: Built-in gradient, light, dark, and minimal themes + customizable CSS variables.
  • 🌐 Dual Usage: Use as a Vue 3 Component / Plugin OR as a Standalone Embeddable Widget in plain HTML, PHP, WordPress, React, etc., via a <script> tag.
  • ⚡ TypeScript Support: Full TypeScript definitions included (index.d.ts).

📦 Installation

npm install nepali-calendar-vue
# or
yarn add nepali-calendar-vue
# or
pnpm add nepali-calendar-vue

🚀 Quick Start (Vue 3)

1. Local Component Usage (Recommended)

<template>
  <NepaliCalendar
    theme="gradient"
    :compact="false"
    :show-header="true"
    :show-today-bar="true"
    @date-click="onDateClick"
    @month-change="onMonthChange"
  />
</template>

<script setup>
import { NepaliCalendar } from 'nepali-calendar-vue';
import 'nepali-calendar-vue/dist/style.css';

const onDateClick = (data) => {
  console.log('Date clicked:', data);
};

const onMonthChange = (data) => {
  console.log('Month changed:', data);
};
</script>

2. Offline Mode with Custom Events

You can use the calendar completely offline without connecting to any backend API:

<template>
  <NepaliCalendar
    :offline="true"
    :custom-events="myEvents"
  />
</template>

<script setup>
import { NepaliCalendar } from 'nepali-calendar-vue';
import 'nepali-calendar-vue/dist/style.css';

const myEvents = [
  { date: '2081-05-15', event: 'Company Annual Meeting', holiday: false },
  { gate: 10, event: 'Special Festival', holiday: true, tithi: 'दशमी' }
];
</script>

🌐 Standalone Widget (Vanilla HTML / CDN / WordPress / PHP)

You can embed the calendar as a widget into any non-Vue website using a single CDN <script> tag.

Option A: Manual JavaScript Initialization

<!DOCTYPE html>
<html lang="ne">
<head>
  <meta charset="UTF-8">
  <!-- 1. Include Stylesheet -->
  <link rel="stylesheet" href="https://unpkg.com/nepali-calendar-vue/dist/style.css">
</head>
<body>

  <!-- 2. Container Element -->
  <div id="nepali-calendar-widget" style="max-width: 400px;"></div>

  <!-- 3. Include Standalone Widget Script -->
  <script src="https://unpkg.com/nepali-calendar-vue/dist/nepali-calendar-widget.iife.js"></script>

  <!-- 4. Initialize Widget -->
  <script>
    NepaliCalendarWidget.init('#nepali-calendar-widget', {
      compact: true,            // Compact widget mode
      theme: 'gradient',        // 'gradient' | 'light' | 'dark' | 'minimal'
      onDateClick: function(dateInfo) {
        console.log('Clicked on date:', dateInfo);
      }
    });
  </script>
</body>
</html>

Option B: Auto-initialization via HTML Data Attributes

Simply add data-nepali-calendar-widget to any <div>:

<link rel="stylesheet" href="https://unpkg.com/nepali-calendar-vue/dist/style.css">
<script src="https://unpkg.com/nepali-calendar-vue/dist/nepali-calendar-widget.iife.js"></script>

<!-- Full Calendar -->
<div data-nepali-calendar-widget data-theme="gradient"></div>

<!-- Compact Sidebar Widget -->
<div data-nepali-calendar-widget data-compact="true" data-theme="light"></div>

<!-- Custom API Endpoint -->
<div data-nepali-calendar-widget data-api-url="https://your-domain.com/api"></div>

⚙️ Props Reference

| Prop | Type | Default | Description | | :--- | :--- | :--- | :--- | | apiUrl | String | 'https://bhujelrajib.com.np/api' | Base API URL for fetching calendar month data and event details | | offline | Boolean | false | When true, disables API calls and computes the entire BS calendar locally | | customEvents / events | Array | [] | Array of custom events/holidays (works both online and offline) | | theme | String | 'gradient' | Calendar theme: 'gradient', 'light', 'dark', 'minimal' | | compact / widget | Boolean | false | Enable compact mode (optimized for sidebars / embed widgets) | | initialYear | Number | Current Nepali Year | Initial Nepali year to display (e.g. 2081) | | initialMonth | Number | Current Nepali Month | Initial Nepali month (1 = बैशाख, 12 = चैत) | | showHeader | Boolean | true | Show top navigation header with month/year dropdowns | | showBrand | Boolean | true | Show "📅 नेपाली पात्रो" brand icon and text in header | | showMonthHeader | Boolean | true | Show month banner card header | | showTodayBar | Boolean | true | Show "आजको मिति" info bar when viewing another month | | showEvents | Boolean | true | Show festival and event badges in date cells | | showTithi | Boolean | true | Show tithi text in date cells | | showEnglishDate | Boolean | true | Show Gregorian English date in date cells | | showModal | Boolean | true | Open event details popup modal when a date cell is clicked | | language | String | 'np' | Numeral format: 'np' (Devanagari: १, २, ३) or 'en' (1, 2, 3) | | enableNavButtons | Boolean | true | Show previous (◀) and next (▶) month buttons | | minYear | Number | 2070 | Minimum year in dropdown | | maxYear | Number | 2095 | Maximum year in dropdown |


📡 Events Reference

| Event | Payload | Description | | :--- | :--- | :--- | | @date-click | { cell, year, month, gate } | Fired when any date cell is clicked | | @month-change | { year, month, monthName } | Fired when month or year is changed | | @event-click | { event, cell } | Fired when a cell containing an event is clicked | | @loaded | { calendars, mahina, year, month } | Fired after calendar data is loaded | | @error | error | Fired if the API request fails (graceful offline fallback triggered) |


🎨 Themes

  • gradient: Vibrant purple-indigo gradient header with colorful accents (Default).
  • light: Crisp, modern card with subtle shadows and clean slate accents.
  • dark: High-contrast dark mode design for dark-themed applications and dashboards.
  • minimal: Flat border-based design that seamlessly blends into any container.

🏗️ Building & Hosting the Live Demo

To build the standalone interactive demo for hosting at https://democalendar.bhujelrajib.com.np:

# 1. Install dependencies
npm install

# 2. Run local development server
npm run dev

# 3. Build demo production bundle (outputs to dist-demo)
npm run build:demo

# 4. Preview the production build locally
npm run preview

Deploy the generated dist-demo directory to your web server / Nginx / Apache pointing to your domain https://democalendar.bhujelrajib.com.np.


📄 License

MIT © Rajib Bhujel