
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
@atawi/react-date-picker
Advanced tools
A beautiful, customizable date and time picker component for React with multiple themes and localization support
A beautiful, customizable date and time picker component for React with comprehensive built-in styling, multiple themes and localization support.
npm install @atawi/react-date-picker
The library works out of the box with comprehensive built-in styles. Simply import the component and start using it:
import { DateTimePicker } from "@atawi/react-date-picker";
function App() {
const [date, setDate] = useState(new Date());
return <DateTimePicker value={date} onChange={setDate} showTime />;
}
The library includes comprehensive built-in styles that provide:
import { DateTimePicker } from "@atawi/react-date-picker";
function App() {
const [date, setDate] = useState(new Date());
return <DateTimePicker value={date} onChange={setDate} showTime />;
}
// Basic date picker
<DateTimePicker
value={date}
onChange={setDate}
mode="single"
showTime={false}
/>
// With time selection
<DateTimePicker
value={date}
onChange={setDate}
mode="single"
showTime
use24Hour={false}
/>
const [dateRange, setDateRange] = useState<[Date, Date]>([
new Date(),
addDays(new Date(), 5),
]);
<DateTimePicker
value={dateRange}
onChange={setDateRange}
mode="range"
showTime={false}
/>;
const [weekRange, setWeekRange] = useState<[Date, Date]>([
startOfWeek(new Date()),
endOfWeek(new Date()),
]);
<DateTimePicker
value={weekRange}
onChange={setWeekRange}
mode="week"
showTime={false}
/>;
const notes = [
{
date: new Date(),
note: "Today's special event: Team meeting at 2 PM",
},
{
startDate: addDays(new Date(), 3),
endDate: addDays(new Date(), 5),
note: "Annual conference in New York",
},
];
<DateTimePicker value={date} onChange={setDate} mode="single" notes={notes} />;
<DateTimePicker
value={date}
onChange={setDate}
mode="single"
showTime
darkMode={true}
/>
const [selectedDate, setSelectedDate] = useState(new Date());
const [isOpen, setIsOpen] = useState(false);
<DateTimePicker
value={selectedDate}
onChange={setSelectedDate}
mode="single"
showTime
isOpen={isOpen}
onOpenChange={setIsOpen}
footer={
<div
style={{
marginTop: "1rem",
paddingTop: "1rem",
borderTop: "1px solid #e5e7eb",
display: "flex",
justifyContent: "flex-end",
}}
>
<ConfirmButton
onConfirm={() => {
// Handle confirmation
setIsOpen(false);
}}
/>
</div>
}
/>;
import { TimePicker } from "@atawi/react-date-picker";
const [time, setTime] = useState(new Date());
<TimePicker value={time} onChange={setTime} use24Hour={false} />;
You can customize the appearance using CSS classes:
const customStyles = {
containerClassName: "my-date-picker",
triggerClassName: "my-trigger-button",
calendarClassName: "my-calendar",
dayClassName: "my-day-button",
selectedDayClassName: "my-selected-day",
};
<DateTimePicker value={date} onChange={setDate} styles={customStyles} />;
Then style with CSS:
.my-date-picker {
/* Custom container styles */
}
.my-trigger-button {
background: #f0f0f0;
border: 2px solid #ccc;
border-radius: 8px;
}
.my-selected-day {
background: #ff6b6b;
color: white;
}
| Prop | Type | Default | Description |
|---|---|---|---|
value | Date | [Date, Date] | new Date() | Selected date or date range |
onChange | (date: Date | [Date, Date]) => void | Required | Callback when date changes |
mode | 'single' | 'range' | 'week' | 'single' | Selection mode |
showTime | boolean | true | Show time picker |
use24Hour | boolean | false | Use 24-hour format |
disabled | boolean | false | Disable the picker |
disabledDates | Date[] | [] | Array of disabled dates |
locale | Locale | undefined | date-fns locale object |
notes | DateNoteType[] | [] | Array of date notes |
darkMode | boolean | false | Enable dark mode styling |
isOpen | boolean | undefined | Control open state |
onOpenChange | (isOpen: boolean) => void | undefined | Callback when open state changes |
footer | React.ReactNode | undefined | Custom footer content |
styles | StyleProps | {} | Custom style classes |
| Prop | Type | Default | Description |
|---|---|---|---|
value | Date | Required | Selected time |
onChange | (date: Date) => void | Required | Callback when time changes |
use24Hour | boolean | false | Use 24-hour format |
disabled | boolean | false | Disable the picker |
darkMode | boolean | false | Enable dark mode styling |
styles | StyleProps | {} | Custom style classes |
| Prop | Type | Description |
|---|---|---|
containerClassName | string | Class for the main container |
triggerClassName | string | Class for the trigger button |
calendarClassName | string | Class for the calendar container |
dayClassName | string | Class for calendar day buttons |
selectedDayClassName | string | Class for selected day |
rangeClassName | string | Class for days in range |
timePickerClassName | string | Class for time picker section |
The library comes with beautiful built-in styles that work out of the box. You can customize the appearance by:
styles prop to apply custom CSS classesdarkMode prop for automatic dark mode stylingThe library includes several built-in visual themes:
darkMode prop)The component is built with accessibility in mind:
We welcome contributions! Please see our Contributing Guide for details.
MIT © Atawi
FAQs
A beautiful, customizable date and time picker component for React with multiple themes and localization support
We found that @atawi/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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.