
Security News
Open Source Maintainers Demand Ability to Block Copilot-Generated Issues and PRs
Open source maintainers are urging GitHub to let them block Copilot from submitting AI-generated issues and pull requests to their repositories.
lonare-react-date-picker
Advanced tools
A modern, customizable date picker component for React applications, built with Tailwind CSS. This component provides an intuitive interface for date selection with various configuration options.
npm install lonare-react-date-picker
or with yarn:
yarn add lonare-react-date-picker
This package requires the following peer dependencies:
{
"react": ">=16.8.0",
"react-dom": ">=16.8.0",
"@heroicons/react": ">=2.0.0"
}
Make sure you have Tailwind CSS configured in your project.
import { DatePicker } from 'lonare-react-date-picker';
function App() {
const handleDateChange = (date) => {
console.log('Selected date:', date);
};
return (
<DatePicker
setDate={handleDateChange}
yearRange={{ before: 5, after: 5 }}
/>
);
}
Prop | Type | Default | Description |
---|---|---|---|
default_date | Date | string | new Date() | Initial date to display |
align | 'left' | 'right' | 'left' | Alignment of the date picker dropdown |
defaultYear | number | null | Pre-selected year |
defaultMonth | number | null | Pre-selected month (0-11) |
setDate | function | undefined | Callback function when date is selected |
dateFuture | boolean | false | Only allow future dates |
datePast | boolean | false | Only allow past dates |
dateRangeStart | Date | string | null | Start date for range restriction |
dateRangeEnd | Date | string | null | End date for range restriction |
yearRange | object | { before: 0, after: 5 } | Number of years to show before/after current year |
<DatePicker setDate={(date) => console.log(date)} />
<DatePicker
dateRangeStart="2023-01-01"
dateRangeEnd="2024-12-31"
setDate={(date) => console.log(date)}
/>
<DatePicker
dateFuture={true}
setDate={(date) => console.log(date)}
/>
<DatePicker
yearRange={{ before: 10, after: 10 }}
setDate={(date) => console.log(date)}
/>
The component uses Tailwind CSS classes for styling. You can override the default styles by wrapping the component in a parent element with custom Tailwind classes.
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.
Lonare
If you like this project, please consider giving it a βοΈ on GitHub!
For bugs and feature requests, please create an issue.
The component uses Tailwind CSS classes which can be overridden using your project's Tailwind configuration.
Yes, the component is compatible with Next.js projects.
Yes, you can integrate it with form libraries like Formik or React Hook Form using the `setDate` prop.
FAQs
A simple React DatePicker component with Tailwind CSS
We found that lonare-react-date-picker demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago.Β It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Open source maintainers are urging GitHub to let them block Copilot from submitting AI-generated issues and pull requests to their repositories.
Research
Security News
Malicious Koishi plugin silently exfiltrates messages with hex strings to a hardcoded QQ account, exposing secrets in chatbots across platforms.
Research
Security News
Malicious PyPI checkers validate stolen emails against TikTok and Instagram APIs, enabling targeted account attacks and dark web credential sales.