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

newpaper-calendar

v1.0.0

Published

A customizable, feature-rich calendar component for React Native - Newpaper Calendar

Readme

Newpaper Calendar

A highly-customisable, feature-rich calendar component for React Native and Expo.
It supports month / week / day views, full CRUD event management, theming, and hybrid (controlled / uncontrolled) state management – making it perfect for everything from quick prototypes to production scheduling apps.

Calendar Pro hero image


Features

  • Three views – month, week and day
  • Event CRUD – create, edit, delete with colour coding
  • Hybrid state – library can manage its own state or be 100 % controlled by the parent
  • Fully themable – override any colour, font, spacing or radius value
  • Configurable icons – uses Expo Ionicons by default, but any React component works
  • Accessible & keyboard-friendly
  • Type-safe – written in TypeScript with full declaration files
  • No native code – pure JS, runs on iOS, Android and Web

Installation

# with npm
npm install newpaper-calendar date-fns
# or with yarn / pnpm
yarn add newpaper-calendar date-fns

Peer dependencies

| Package | Version (or higher) | |----------|---------------------| | react | 16.8.0 | | react-native | 0.60.0 | | date-fns | 2.0.0 |

Expo projects already include compatible versions of React and React Native.
Because icons default to Ionicons, ensure you have them (Expo SDK already does):

expo install @expo/vector-icons

Quick Start (Uncontrolled Mode)

import React from 'react';
import { Calendar } from 'newpaper-calendar';

export default function App() {
  return (
    <Calendar
      /* just pass events to start */
      defaultEvents={[
        {
          id: '1',
          title: 'Kick-off',
          date: '2025-06-01',
          time: '09:00',
          color: '#5E60CE',
        },
      ]}
    />
  );
}

In uncontrolled mode the library keeps its own state.
Use callbacks such as onEventsChange or onDateSelect to stay in sync.


Controlled Mode

import React, { useState } from 'react';
import { Calendar, CalendarEvent } from 'newpaper-calendar';

export default function ControlledDemo() {
  const [selectedDate, setSelectedDate] = useState(new Date());
  const [events, setEvents] = useState<CalendarEvent[]>([]);

  return (
    <Calendar
      /* 100 % controlled */
      selectedDate={selectedDate}
      events={events}
      view="week"
      onDateSelect={setSelectedDate}
      onEventsChange={setEvents}
      onEventCreate={(date) => console.log('Create new on', date)}
    />
  );
}

Advanced Configuration

Theming

Override any part of the default theme:

import { Calendar, defaultTheme } from 'newpaper-calendar';

const myTheme = {
  ...defaultTheme,
  primary: '#6366F1',
  background: '#F9FAFB',
  text: '#111827',
  eventColors: ['#22D3EE', '#F87171', '#A78BFA'],
};

<Calendar theme={myTheme} />;

Custom Icons

Pass an object whose keys match the icon slots.
Any React component (SVG, PNG, FontIcon, etc.) is accepted.

import { MaterialIcons } from '@expo/vector-icons';

const icons = {
  chevronLeft: (p) => <MaterialIcons name="chevron-left" {...p} />,
  chevronRight: (p) => <MaterialIcons name="chevron-right" {...p} />,
  plus: (p) => <MaterialIcons name="add" {...p} />,
};

<Calendar icons={icons} />;

Disabling Internal Modals

Use the event callbacks exclusively and set feature flags:

<Calendar
  enableEventCreation={false}
  enableEventEditing={false}
  onEventPress={(e) => navigation.navigate('EventDetails', { e })}
/>

API Reference

<Calendar /> Props

| Prop | Type | Default | Description | |------|------|---------|-------------| | events | CalendarEvent[] | – | Controlled events array | | defaultEvents | CalendarEvent[] | [] | Uncontrolled starting events | | selectedDate | Date | – | Controlled selected date | | defaultSelectedDate | Date | new Date() | Uncontrolled starting date | | view | 'month'\|'week'\|'day' | – | Controlled view | | defaultView | Same as above | 'month' | Uncontrolled view | | settings | Partial<CalendarSettings> | – | Controlled settings | | defaultSettings | Partial<CalendarSettings> | – | Uncontrolled settings | | theme | Partial<CalendarTheme> | – | Theme overrides | | icons | Partial<CalendarIcons> | Ionicons defaults | Custom icon set | | enableEventCreation | boolean | true | | enableEventEditing | boolean | true | | enableSettings | boolean | true | | showHeader | boolean | true | | showNavigation | boolean | true | | — Callbacks — | | onDateSelect(date) | (Date) => void | – | | onEventsChange(events) | (CalendarEvent[]) => void | – | | onViewChange(view) | (CalendarView) => void | – | | onEventPress(event) | (CalendarEvent) => void | – | | onEventCreate(date) | (Date) => void | – | | onEventEdit(event) | (CalendarEvent) => void | – | | onEventDelete(id) | (string) => void | – | | onSettingsChange(settings) | (CalendarSettings) => void | – |

CalendarEvent

interface CalendarEvent {
  id: string;
  title: string;
  description?: string;
  date: 'YYYY-MM-DD';
  time: 'HH:MM';
  endTime?: 'HH:MM';
  location?: string;
  color?: string; // hex
  isAllDay?: boolean;
}

CalendarTheme

See defaultTheme exported from the package for the full structure.


Utility Helpers

All date-helper functions are re-exported:

import { formatToISODate, getWeekNumber } from 'newpaper-calendar';

TypeScript

The package ships with .d.ts files – IDEs get full IntelliSense.


Example App

An Expo example is located in /library/example.
Run it locally:

cd library/example
yarn && expo start

Contributing

PRs & issues are welcome!
Please open an issue first if you plan major changes.

git clone https://github.com/yourname/react-native-calendar-pro
cd react-native-calendar-pro
yarn
yarn example # run demo

License

MIT © Aloy Sathekge