1.1.2 • Published 11 months ago

aekimena-month-year-picker v1.1.2

Weekly downloads
-
License
MIT
Repository
github
Last release
11 months ago

aekimena-month-year-picker

A customizable month-year picker component for React Native. Easily integrate a month-year picker with various customization options to fit your app's design.

Installation

You can install the package via npm or yarn:

  npm install aekimena-month-year-picker

or

  yarn add aekimena-month-year-picker

Basic Usage

import React, { useState } from "react";
import { View, StyleSheet, Button } from "react-native";
import MonthYearPicker from "aekimena-month-year-picker";

const App = () => {
  const [visible, setVisible] = useState(false);
  const [date, setDate] = useState(null);

  return (
    <View style={styles.container}>
      <Button title="Show Picker" onPress={() => setVisible(true)} />
      <MonthYearPicker
        visible={visible}
        onRequestClose={() => setVisible(false)}
        onConfirm={(text) => {
          setDate(text);
        }}
      />
    </View>
  );
};

export default App;

const styles = StyleSheet.create({
  container: {
    flex: 1,
    backgroundColor: "#9FBBBB",
    justifyContent: "center",
    alignItems: "center",
  },
});

Props

PropsTypeDescriptionDefault
visiblebooleanDetermines whether the month-year picker is visiblefalse
animationType"none" | "slide" | "fade"Specifies the animation type for the modal presentation."fade"
transparentbooleanIndicates if the modal should be transparent.true
onRequestClose() => voidCallback function triggered when the request to close the modal occurs.
onBackgroundPress() => voidCallback function triggered when the modal background is pressed.
opacitynumberSets the opacity of the modal background.0.5
containerStyleViewStyleCustom styles for the month-year picker container.
maxDatestringSpecifies the maximum date that can be selected."Current date"
minDatestringSpecifies the minimum date that can be selected."2000-01-01"
onConfirm(text: string) => voidCallback function triggered when the confirm button is pressed.
showDaysbooleanDetermines if the days list should be showntrue
highlighterStyleViewStyleCustom styles for the highlighter.
itemTextStyleTextStyleCustom styles for the text items.
itemContainerStyleViewStyleCustom styles for the text item container.
buttonStyleViewStyleCustom styles for the button.
buttonTextStyleTextStyleCustom styles for the button text.
buttonTextstringText displayed on the button."Confirm"
highlightedItemStyleTextStyleCustom styles for the highlighted items

Contributing

To get started...

Step 1

  • Option 1

    • 🍴 Fork this repo!
  • Option 2

    • 👯 Clone this repo to your local machine using https://github.com/aekimena/month-year-picker

Step 2

  • DO YOUR THING! 🤌

Step 3

  • 🔃 Create a new pull request using https://github.com/aekimena/month-year-picker.

License

License