1.1.13 • Published 6 months ago

multi-year-select v1.1.13

Weekly downloads
-
License
ISC
Repository
-
Last release
6 months ago

MultiYearSelect - A Flexible React Multi-Year Selector Component

npm version license

Overview

MultiYearSelect is a highly customizable and lightweight React component for selecting multiple years from a specified range. Its user-friendly interface and flexibility make it ideal for applications requiring a year range picker, such as experience selection forms, data filters, and more.


Key Features

  • šŸ“† Customizable Year Range: Dynamically define the start and end years.
  • šŸ–±ļø Intuitive UI: Easy-to-use dropdown with multi-select functionality.
  • šŸŽØ Stylable: Customize styles using custom class names.
  • šŸ”„ Real-Time Updates: Get selected years via callback in real time.
  • šŸš€ Lightweight: Minimal dependencies ensure optimal performance.

Installation

Install the package using npm or yarn:

npm install multi-year-select

or

yarn add multi-year-select

Usage

Integrating MultiYearSelect into your React project is simple. Here's an example:

import React from "react";
import MultiYearSelect from "multi-year-select";

const App = () => {
  const handleSelectionChange = (selectedYears) => {
    console.log("Selected years:", selectedYears);
  };

  return (
    <div>
      <h1>Multi-Year Selector</h1>
      <MultiYearSelect
        startYear={2000}
        endYear={2030}
        onSelectionChange={handleSelectionChange}
        className="custom-class"
      />
    </div>
  );
};

export default App;

Props

PropTypeDefaultDescription
startYearnumber2000The first year in the selectable range.
endYearnumberCurrent yearThe last year in the selectable range.
onSelectionChangefunctionundefinedCallback for handling selected years.
classNamestringOptionalAdditional classes for custom styling.

Demo

Live Demo on CodeSandbox


Why Choose MultiYearSelect?

  1. Accessibility: Designed to be inclusive and user-friendly.
  2. Flexibility: Ideal for use cases like year filters, date range pickers, or experience selection.
  3. Ease of Integration: Seamlessly integrates into any React project.

Styling and Customization

You can style MultiYearSelect by overriding the default styles with custom CSS classes. Use the className prop to apply your own styles.

Example CSS:

.custom-class {
  width: 100%;
  max-width: 300px;
}
.custom-class .selected-year {
  background-color: #007bff;
  color: #fff;
  border-radius: 5px;
}

Contributing

Contributions are welcome! If you have ideas for improvements or find any issues, feel free to submit an issue or create a pull request.

Steps to Contribute

  1. Fork the repository.
  2. Create a feature branch.
  3. Commit your changes and submit a pull request.

License

This project is licensed under the MIT License.


Keywords

React, Multi-Year Select, Year Picker, Dropdown Selector, React Year Range, Custom Year Picker, MultiSelect, React Component


Support

For questions or issues, feel free to reach out or file an issue.


Stay Updated

⭐ Star this repository if you find it helpful!
šŸ“¢ Follow us on GitHub for updates.


Start using MultiYearSelect today to enhance your React projects with an elegant and efficient year selection feature! šŸŽ‰

1.1.13

6 months ago

1.1.11

6 months ago

1.1.10

6 months ago

1.1.9

6 months ago

1.1.8

6 months ago

1.1.7

6 months ago

1.1.6

6 months ago

1.1.5

6 months ago

1.1.4

6 months ago

1.1.3

6 months ago

1.1.2

6 months ago

1.1.1

6 months ago

1.1.0

6 months ago

1.0.1

6 months ago

1.0.0

6 months ago