npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@borase-healthcare-limited/react-native-horizontal-calender

v1.1.9

Published

A customizable, horizontally scrollable calendar component for React Native. Perfect for applications requiring a sleek, minimal calendar design with the ability to select and display dates. Designed to be simple yet powerful, this component allows develo

Downloads

616

Readme

version: 1.1.9

@borase-healthcare-limited/react-native-horizontal-calender

A customizable, horizontally scrollable calendar component for React Native. Perfect for applications requiring a sleek, minimal calendar design with the ability to select and display dates. Designed to be simple yet powerful, this component allows developers to easily integrate a horizontal calendar view into their apps.

Features

  • Horizontally scrollable week view: Navigate between weeks with smooth transitions.
  • Customizable appearance: Easily style day containers, selected dates, and other UI elements.
  • Optional navigation controls: Show or hide left/right arrow buttons for week navigation.
  • Selected Date Box: Display details of the selected date in a scrollable box (can be toggled on/off).
  • Marked Dates: Highlight specific dates with custom colors provided via the markedDates prop.
  • Responsive design: Automatically adjusts day container sizes based on screen width and arrow button visibility.
  • Highlighted Date: Option to specify a highlighted date that the calendar scrolls to by default.

Installation

You can install this package using npm or yarn:

npm install @borase-healthcare-limited/react-native-horizontal-calender

Or with yarn:

yarn add @borase-healthcare-limited/react-native-horizontal-calender

Usage

Here's an example of how to use the Calendar component in your React Native project:

import React from 'react';
import Calendar from '@borase-healthcare-limited/react-native-horizontal-calender';

const MyApp = () => {
  const markedDates = [
    { date: '2024-10-02', bgColor: 'red', color: '#FEDEBA' },
    { date: '2024-10-15', bgColor: 'red', color: '#DF7689' },
  ];

  const handleDateSelect = (date) => {
    console.log("Selected date:", date.format("YYYY-MM-DD"));
  };

  const renderCustomDateBox = ({ date }) => (
    <View>
      <Text>{date.format('MMMM Do YYYY')}</Text>
    </View>
  );

  return (
    <Calendar
      showArrowIcons={true}
      showDateBox={true}
      markedDates={markedDates}
      highlightedDate="2024-10-15"
      onDateSelect={handleDateSelect}
      renderDateBox={renderCustomDateBox}
      customStyles={{
        dayContainer: { borderColor: '#ddd' },
        selectedDayContainer: { backgroundColor: '#4CAF50' },
        dayName: { fontSize: 12 },
        date: { fontSize: 14 },
      }}
    />
  );
};

export default MyApp;

Props

| Prop | Type | Default | Description | | ------------------- | ------------------------------------------ | -------- | -------------------------------------------------------------------------------------------------------------------- | | showArrowIcons | boolean | true | Show or hide the left and right navigation icons. | | showDateBox | boolean | true | Toggle the visibility of the selected date info box. | | customStyles | object | {} | Customize the styles of various calendar components such as day containers, selected day background, and text fonts. | | LeftArrowIcon | component | null | Custom component for the left navigation arrow. | | RightArrowIcon | component | null | Custom component for the right navigation arrow. | | markedDates | Array<{ date: string, color: string }> | [] | Highlight specific dates with custom colors (YYYY-MM-DD). | | highlightedDate | string | null | Specify a date (YYYY-MM-DD) to be highlighted and scrolled to on load. | | onDateSelect | function | null | Callback triggered when a date is selected, returning the selected date as a Moment object. | | renderDateBox | function | null | Custom function to render the selected date box content. Receives { date: Moment } as props. |

Custom Styles

You can pass custom styles to the calendar via the customStyles prop. Available style keys include:

  • dayContainer: Style for each day container.
  • selectedDayContainer: Style for the selected day.
  • dayName: Style for the day name (e.g., Mon, Tue).
  • date: Style for the date number.
  • todayContainer: Style for the container of today's date.
  • headerContainer: Style for the header container showing the month.
  • headerMonthName: Style for the displayed month name.

Example of Customization

<Calendar
  showArrowIcons={false}
  customStyles={{
    dayContainer: { width: 50, height: 50 },
    selectedDayContainer: { backgroundColor: 'blue' },
    dayName: { fontSize: 14, color: 'black' },
    date: { fontSize: 16, color: 'black' },
  }}
/>

Marked Dates

The markedDates prop allows you to highlight specific dates with custom colors. Pass an array of objects with the following structure:

const markedDates = [
  { date: '2024-10-02', bgColor: 'red', color: '#FEDEBA' },
  { date: '2024-10-15', bgColor: 'red', color: '#DF7689' },
];

Example

<Calendar
  markedDates={markedDates}
/>

In this example, the specified dates will be highlighted with the corresponding colors.

License

MIT License. See LICENSE for more details.

Author

Amit Saha