react-calendarize

1.0.2 • Public • Published

React Calendarize

This is a simple React calendar component that can display messages on specific dates. It is responsive and can be used in any React application.

Installation

To install this component in your project, you can use npm:

npm install react-calendarize

Usage

To use the calendar component, you can import it into your React component and render it as follows:

import Calendar from "react-calendarize";

function MyComponent() {
  const messages = [
    {
      text: "Meeting with John",
      date: "2023-05-10",
    },
    {
      text: "Dentist appointment",
      date: "2023-05-13",
    },
    {
      text: "Buy groceries",
      date: "2023-05-15",
    },
    {
      text: "Hiking trip",
      date: "2023-05-28",
    },
  ];

  return <Calendar data={messages} />;
}

By default, the calendar will display the current month with large date boxes. If a message is associated with a date, it will be displayed in the corresponding box.

Props

The following props can be passed to the calendar component to customize its behavior:

  • messages: An array of objects representing messages to be displayed on specific dates. Each object should have a date property (in YYYY-MM-DD format) and a message property (a string). Defaults to an empty array.

Package Sidebar

Install

npm i react-calendarize

Weekly Downloads

2

Version

1.0.2

License

ISC

Unpacked Size

6.2 kB

Total Files

4

Last publish

Collaborators

  • singhlify