calendareact
v1.1.5
Published
A TS calendar component built with MUI and Dayjs
Downloads
8
Maintainers
Readme
calendaЯReact
A simple react+dayjs calendar component with 3 views:
Small
Week
Month
Example app
Installation
npm i calendareact
Usage
import React, { useState } from 'react';
import Calendar from 'calendareact';
function App() {
const [selectedDate, setSelectedDate] = useState<Dayjs>(dayjs())
return (
<Calendar
// events - list of events to display in the calendar
events={[]}
colors={colors}
selectedDate={selectedDate}
onSelectTime={onSelectTime}
onSelectDate={(date: dayjs.Dayjs) => setSelectedDate(date)}
onSelectEvent={onSelectEvent}
onEditEvent={onEditEvent}
onDeleteEvent={onDeleteEvent}
onApproveEvent={onApproveEvent}
showApprove={showApprove}
// errors - display errors on day headers
errors={errors}
// dayActions - Add buttons to the day headers
dayActions={dayActions}
/>
);
}
export default App;