0.0.4 • Published 2 years ago

react-carousel-calendar v0.0.4

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

React Carousel Calendar

  • React calendar with carousel style.
  • Check-in, Check-out changes status by selection, and the status is available as a Date object.

Installation

npm install react-carousel-calendar

Demo

A minimal demo page can be found in sample directory,

Online Demo : CodeSandbox

carousel-01

Usage

import {
  Calendar,
  CalendarContainer,
  CalendarProvider,
} from 'react-carousel-calendar';

function App() {
  return (
    <div className='App'>
      <h1>Hello Calendar</h1>
      <CalendarProvider>
        <CalendarContainer>
          <Calendar />
        </CalendarContainer>
      </CalendarProvider>
    </div>
  );
}

export default App;

If you want to use the selected date (ex. check-in, check-out), Please check the SampleCheckin, SampleCheckout Component as well.

carousel-02

User Guide

CalendarProvider

Props

Prop nameDescriptionDefault valueExample value
langLanguage to be displayed on the calendaruser's navigator.language or 'en-US''en-US' or 'ko-KR'
isPastClickableDecide if you want to click on a date before todayfalsefalse or true

If you want to add language, please issue to me 😊

CalendarContainer

  • Container is optional, if you have any container, you can use that.
  • Just I recommend 5:3 width, height ratio, and min-width 400px

Props

Prop nameDescriptionDefault valueExample value
widthCalendar Container's width50use Number value
heightCalendar Container's height, if you don't give this, it's calculated by aspect ratio30use Number value
cssUnitWidth's and Height's unit'rem''rem', 'px', ..etc
noPaddingDelete container's default paddingfalsefalse or true
noBoxShadowDelete container's default box shadowfalsefalse or true
cStyleIf you want to add a custom style, add it here. like inline stylenull'color: blue;'