A powerful, flexible, and headless calendar hook for React
npm install @code-s/react-headless-calendarA powerful, flexible, and headless calendar hook for React. Build beautiful date pickers, calendars, and date range selectors with complete control over styling and behavior.
- 🎨 Headless - Complete control over UI and styling
- 🌍 i18n Support - Full internationalization with locale support
- ♿ Accessible - Built with accessibility in mind
- 📦 Lightweight - Zero dependencies (except React)
- 🎯 TypeScript - Full type safety out of the box
- 🔧 Flexible - Controlled and uncontrolled modes
- 🚀 Modern - Built with React hooks
``bash`
npm install @code-s/react-headless-calendar
`bash`
yarn add @code-s/react-headless-calendar
`bash`
pnpm add @code-s/react-headless-calendar
`tsx
import { useCalendar } from '@code-s/react-headless-calendar';
function Calendar() {
const {
weeks,
weekDays,
monthName,
currentYear,
goToNextMonth,
goToPreviousMonth,
} = useCalendar();
return (
onClick={goToNextMonth}
className="p-2 hover:bg-gray-100 rounded"
>
→
{/ Weekdays /}
{/ Days /}
{weeks.map((week, i) => (
}
>
{day.day}
))}
Happy coding! 🚀
If you find this useful, please give it a star. Thanks! ⭐