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

@dlavvv/calendar-view-component

v1.0.2

Published

A customizable calendar web component built with Lit

Readme

📅 Calendar View Component

A lightweight and easy-to-use tool for integrating a monthly calendar into your web applications. It's built with Lit to ensure high performance and native browser compatibility.

Features

  • Performance: Built with LitElement for minimal overhead and lightning-fast rendering
  • Interactive Navigation: Seamlessly browse through months and years
  • Date Selection: Highlight and select specific days with visual feedback
  • Auto-Logic: Handles all calendar calculations (leap years, month start days) automatically
  • Clean UI: A minimalist design that fits any modern dashboard or interface
  • Custom Events: Emits a standard event whenever a date is selected
  • Framework Agnostic: Works everywhere (React, Vue, Angular, or plain HTML/JS)

Requirements

  • Node.js: 18.x or higher (recommended)
  • Browser: Modern browsers with Custom Elements (V1) and Shadow DOM support (Chrome, Firefox, Safari, Edge)

Installation

Option 1: Install the component via npm:

npm install @dlavvv/calendar-view-component

[!NOTE] This package is published as an ES Module. To use it effectively with npm:

  • With a Bundler: Use a modern build tool like Vite, Webpack, or Rollup. They will automatically handle the lit dependencies for you.
  • Without a Bundler: If you are not using a build tool, you will need to use an import map to tell the browser where to find the Lit library.

Option 2: Using CDN link directly in your HTML:

<script type="module" src="https://esm.sh/@dlavvv/calendar-view-component"></script>

Usage

1. Import the component

In your JavaScript/TypeScript entry point (e.g., main.js or app.js):

import '@dlavvv/calendar-view-component';

2. Use the HTML tag

Simply add the custom element to your HTML file:

<calendar-view></calendar-view>

3. Handle interactions

The component dispatches a date-selected custom event whenever a user clicks on a day. You can capture the selected date like this:

const calendar = document.querySelector('calendar-view');

calendar.addEventListener('date-selected', (event) => {
  // date is provided in "YYYY-MM-DD" format
  console.log('Selected Date:', event.detail.date);
});

Themes

The component is designed with modular styling. Currently, it supports two distinct visual modes: light and dark.

Dark Mode: Optimized for high-contrast dashboards and late-night usage (Default).
Light Mode: A clean, professional look for standard light-themed applications.

Of course, you can also fully customize your calendar by creating a new stylesheet or modifying the existing ones.

How to change styles

Light Mode

Change the import and the static styles property as follows:

import { lightMode } from './styles/light.js';

// inside your class:
static styles = lightMode;

Dark Mode

Similarly, for Dark Mode, use the dark styles import:

import { darkMode } from './styles/dark.js';

// inside your class:
static styles = darkMode;

[!NOTE] Future versions will include a toggle property for dynamic switching.

API References

| Property | Type | Default | Description | | ------------- | ------------- | ------------- | ------------- | | currentMonth | Number | Current Month | The month currently displayed (0-11) | | currentYear | Number | Current Year | The year currently displayed | | selectedDay | Number | Today | The currently highlighted day |

Events

| Event Name | Detail | Description | | ------------- | ------------- | ------------- | | date-selected | { date: string } | Fired when a user selects a valid day |

License

This project is licensed under the ISC License. See the LICENSE file for details.