react-calendarize
v1.0.2
Published
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.
Downloads
2
Maintainers
Readme
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 adate
property (inYYYY-MM-DD
format) and amessage
property (a string). Defaults to an empty array.