Kewti Calendar
An Ethiopian & Gregorian calendar and date picker suite supporting dynamic monthly themes, animations, holiday highlights, popover inputs, multi-select dropdowns, and custom styling.
const CalendarExample = () => { const [selectedDate, setSelectedDate] = useState(new Kenat()); return ( <KewtiCalendar value={selectedDate} showHolidays={true} showAnimations={true} onChange={(date) => setSelectedDate(date)} calendarPref="ethiopian" /> ); }; render(<CalendarExample />);
const DatePickerExample = () => { const [selectedDate, setSelectedDate] = useState(new Kenat()); return ( <div className="space-y-4"> <KewtiDatePicker value={selectedDate} onChange={(date) => setSelectedDate(date)} showHolidays={true} showAnimations={true} calendarPref="ethiopian" /> <p className="text-sm"> Selected: {selectedDate.format({ calendar: "ethiopian", showWeekday: true })} </p> </div> ); }; render(<DatePickerExample />);
const DropdownPickerExample = () => { const [selectedDate, setSelectedDate] = useState(new Kenat()); return ( <div className="max-w-sm space-y-3"> <KewtiDatePickerDropdown value={selectedDate} onChange={(date) => setSelectedDate(date)} calendarPref="ethiopian" showHolidays={true} /> <p className="text-xs"> Selected: {selectedDate.format({ calendar: "ethiopian" })} </p> </div> ); }; render(<DropdownPickerExample />);
Installation
npx kewti-cli add calendarKewti-Calendar uses Kenat.
Usage
import {
KewtiCalendar,
KewtiDatePicker,
KewtiDatePickerDropdown
} from "@/kewti/ui"
import Kenat from "kenat"Basic Calendar
<KewtiCalendar />Date Picker Popover
const [date, setDate] = useState<Kenat>(new Kenat())
<KewtiDatePicker
value={date}
onChange={setDate}
placeholder="ቀን ይምረጡ"
/>Dropdown Date Picker
Render compact Day, Month, and Year select dropdowns. This mode automatically clamps invalid days (including Ethiopian leap years for Pagumē and Gregorian leap years for February).
const [date, setDate] = useState<Kenat>(new Kenat())
<KewtiDatePickerDropdown
value={date}
onChange={setDate}
calendarPref="ethiopian"
showHolidays={true}
/>Gregorian Mode
Switch the preference to Gregorian across any component while maintaining full compatibility with the underlying Kenat date object.
<KewtiDatePicker
calendarPref="gregorian"
placeholder="Select Date"
/>
<KewtiDatePickerDropdown
calendarPref="gregorian"
minYear={1980}
maxYear={2030}
/>Customizing Animations & Holidays
Disable background themes or holiday banners if a cleaner look is desired.
<KewtiCalendar
showAnimations={false}
showHolidays={false}
/>Custom Styling
Pass custom CSS classes or inline styles using the className and style props.
<KewtiCalendar
className="shadow-lg border border-neutral-200 dark:border-neutral-800"
style={{ maxWidth: "320px" }}
/>
<KewtiDatePicker
className="w-full"
style={{ opacity: 0.95 }}
/>
<KewtiDatePickerDropdown
className="max-w-sm"
/>Features
- Dual Calendar Systems: Seamless support for both Ethiopian and Gregorian date conversions powered by
kenat. - Dynamic Month Themes: Beautiful, smooth gradient backgrounds and seasonal animations per Ethiopian month.
- Holiday Indicators & Details: Built-in holiday identification with an interactive info banner upon date selection.
- Three Picker Modes:
- Inline Calendar Grid (
KewtiCalendar): Full-sized calendar view with month switching. - Popover Input (
KewtiDatePicker): Form-friendly input trigger with an animated calendar popover. - Select Dropdowns (
KewtiDatePickerDropdown): Compact multi-select dropdowns for Day, Month, and Year with automatic leap year clamping.
- Inline Calendar Grid (
- Customizable Styling: Pass custom
classNameandstyleproperties to adapt to your design system. - Full Dark Mode Support: Tailored styles for both dark and light modes out of the box.
Props
KewtiCalendar Props
| Prop | Type | Default | Description |
|---|---|---|---|
value | Kenat | today | Controlled date value instance. |
onChange | (date: Kenat) => void | — | Callback fired when a date cell is selected. |
calendarPref | "ethiopian" | "gregorian" | "ethiopian" | Calendar system preference. |
showAnimations | boolean | true | Toggles background theme gradients and monthly animations. |
showHolidays | boolean | true | Highlights public holidays and displays holiday details on tap. |
className | string | "" | Additional CSS class names for styling the root container element. |
style | React.CSSProperties | — | Inline styles applied to the root container element. |
KewtiDatePicker Props
| Prop | Type | Default | Description |
|---|---|---|---|
value | Kenat | — | Controlled date value instance. |
onChange | (date: Kenat) => void | — | Callback fired when a date is selected. |
calendarPref | "ethiopian" | "gregorian" | "ethiopian" | Calendar system preference. |
placeholder | string | "ቀን ይምረጡ" | Placeholder text displayed when no value is provided. |
showAnimations | boolean | true | Passed to the underlying KewtiCalendar. |
showHolidays | boolean | true | Passed to the underlying KewtiCalendar. |
className | string | "" | Additional CSS class names for styling the root container element. |
style | React.CSSProperties | — | Inline styles applied to the root container element. |
KewtiDatePickerDropdown Props
| Prop | Type | Default | Description |
|---|---|---|---|
value | Kenat | today | Controlled date value instance. |
onChange | (date: Kenat) => void | — | Callback fired when any dropdown (day, month, or year) changes. |
calendarPref | "ethiopian" | "gregorian" | "ethiopian" | Calendar system preference. |
minYear | number | 1900 | Minimum selectable year in the year dropdown. |
maxYear | number | 2050 (ET) / 2100 (GC) | Maximum selectable year in the year dropdown. |
showHolidays | boolean | true | Displays a holiday badge below the selects when a holiday is chosen. |
disabled | boolean | false | Disables all dropdown controls. |
labels | { day?: string; month?: string; year?: string } | — | Accessibility aria-labels for the dropdown select elements. |
className | string | "" | Additional CSS class names for styling the container. |
style | React.CSSProperties | — | Inline styles applied to the container. |
Kewti Input
A multilingual input component with Amharic transliteration, spell checking, voice dictation, and controlled/uncontrolled support.
Kewti Time
An Ethiopian & Standard 12-hour time picker component supporting dynamic Amharic time periods (ጠዋት, ከሰዓት, ምሽት, ሌሊት), standard AM/PM modes, 24-hour time state conversion, and custom styling.