native-month-year-selector
v1.1.0
Published
Month Year Selector For React Native Andriod & IOS
Downloads
2
Readme
Month Year Selector
Month Year Selector is a React Native component that allows users to select a month and year.
Installation
To install Month Year Selector, use npm or yarn:
npm install month-year-selector
or
yarn add month-year-selector
Usage
Import the MonthYearSelector component and use it in your React Native application:
import React from 'react'; import { View } from 'react-native'; import MonthYearSelector from 'month-year-selector';
const App = () => { const handleAddButtonPress = (selectedMonth, selectedYear) => { // Handle the button press with the selected month and year values console.log('Add button pressed!', selectedMonth, selectedYear); };
return ( ); };
export default App;
Props
The MonthYearSelector component accepts the following props:
| Prop | Type | Description | | --------------- | -------- | ------------------------------------------ | | onAddButtonPress | Function | Callback function called when the "Add" button is pressed. It receives the selected month and year values as parameters. |
Customization
You can customize the MonthYearSelector component by modifying the styles and adding additional functionality as needed. The component uses the @react-native-picker/picker package for the pickers.
License
This project is licensed under the MIT License. See the LICENSE file for details.