0.3.0 • Published 2 years ago

rn-kalender v0.3.0

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

šŸ“† rn-kalender

npm version

React Native calendar marking component for iOS and Android

āš ļø Implementation is based on react-native-calendars āš ļø

šŸ”† Features

šŸš€ Installation

The package can be installed via npm:

npm install rn-kalender --save

Or via yarn:

yarn add rn-kalender

šŸ¦– Example

import * as React from 'react';
import { SafeAreaProvider, SafeAreaView } from 'react-native-safe-area-context';
import en from 'date-fns/locale/en-GB';

import { Kalender } from './src/index';

function App(): JSX.Element {
  const apple = { key: 'apple', color: '#DE534D', selectedDotColor: 'blue' };
  const mango = { key: 'mango', color: '#E89F3A', selectedDotColor: 'blue' };
  const banana = { key: 'banana', color: '#55B686' };

  const theme = {
    calendarBackground: 'slateblue',
    todayBorderColor: 'tomato',
    todayTextColor: 'tomato',
  };

  return (
    <SafeAreaProvider>
      <SafeAreaView style={{ flex: 1 }}>
        <Kalender
          isList
          periodDates={{
            dates: [
              {
                startDate: '2023-04-03',
                endDate: '2023-04-06',
              },
            ],
          }}
          blockedDates={{
            dates: ['2023-04-15', '2023-05-05'],
          }}
          dotDates={[
            { date: '2023-04-28', dots: [apple, mango] },
            { date: '2023-04-25', dots: [apple, mango, banana] },
          ]}
          theme={theme} // custom theme
          locale={en} // assign custom locale
          animateScroll
        />
      </SafeAreaView>
    </SafeAreaProvider>
  );
}

export default App;

šŸŽØ Theming

categorykeyvalue
systemtextSectionTitleColorCalendar header days text color
systemmonthTextColorCalendar header month text color
systemdisabledBorderColorCalendar disabled day border color
systemdisabledTextColorCalendar disabled day text color
systemcalendarBackgroundCalendar background color
systemdayTextColorCalendar day color
systemtodayBorderColorCalendar today border color
systemtodayTextColorCalendar today text color
markingperiodBackgroundColorCalendar period marking default background color
markingperiodBorderColorCalendar period marking default border color
markingblockedBackgroundColorCalendar blocked days marking default background color
markingblockedTextColorCalendar blocked days marking default text color
markingdotColorCalendar dot marking default color
0.3.0

2 years ago

0.2.0

2 years ago

0.0.0

2 years ago