An open API service indexing awesome lists of open source software.

https://github.com/f0wu5u/calendar-kit

A simple JS only calendar UI for react native
https://github.com/f0wu5u/calendar-kit

react react-native react-native-calendar-ui

Last synced: 6 months ago
JSON representation

A simple JS only calendar UI for react native

Awesome Lists containing this project

README

          

# Introduction
A **simple** and **customizable** React Native component for displaying and interacting with **Gregorian calendar** dates.
![@fowusu/calendar-kit](https://github.com/f0wu5u/calendar-kit/blob/main/static/calendar-kit.png?raw=true)

# Features
- πŸ’‘ 100% Typescript
- ⚑️ Build with `@shopify/flashlist` for faster list rendering
- πŸ•‘ Works in all timezones
- 🎨 Fully customizable with example use cases
- 🈲 Supports localization
- πŸš€ DX, UX and Performance in one lightweight bundle
- πŸ—“οΈ Multiview calendars (`Week`βœ…, `Month`βœ…, Yearly(coming soon)βš™οΈ)
- πŸ‘¨πŸ½β€πŸ’» Works in every RN project including react native web

# Examples

| Vio.com | Airbnb |
|-----------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------|
| | |

| Priceline | Booking.com |
|-----------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------|
| | |

| Localized | Performance |
|-----------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------|
| | |

| Multiview (Week & Year) | Schedule |
|------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------|
| | |

# Installation
To install the package, use npm or yarn:

```bash
npm install @fowusu/calendar-kit
```
or

```bash
yarn add @fowusu/calendar-kit
```

or

```bash
yarn expo add @fowusu/calendar-kit
```

> ⚠️ You need to install `@shopify/flash-list`
```bash
yarn add @shopify/flash-list
```

```bash
yarn expo add @shopify/flash-list
```

# Usage
Here’s a basic example of how to use the `@fowusu/calendar-kit` package:

## Calendar
```typescript jsx
import React, { useCallback, useState } from "react";
import { Calendar, toLocaleDateString } from "@fowusu/calendar-kit";

const today = new Date();

const todayDateString = toLocaleDateString(today);

const CalendarComponent = () => {
const [selectedDay, setSelectedDay] = useState();

const onDayPress = useCallback((dateString) => {
setSelectedDay(dateString);
}, []);

return (

);
};
```

## CalendarList
```typescript jsx
import React, { useCallback, useState } from "react";
import {CalendarList, toLocaleDateString} from "@fowusu/calendar-kit";

const today = new Date();
const todayDateString = toLocaleDateString(today);

const CalendarListComponent = () => {
const [selectedDay, setSelectedDay] = useState();

const onDayPress = useCallback((dateString) => {
setSelectedDay(dateString);
}, []);

return (

);
};
```

# API Reference
See our [API Reference docs](API_REFERENCE.md)
# Contributing
Contributions are welcome! Please see the [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.