# DatePicker with Custom Popup Buttons and Focus Handling

## Environment

<table>
	<tbody>
		<tr>
			<td>Product Version</td>
			<td>12.0.0</td>
		</tr>
		<tr>
			<td>Product</td>
			<td>Progress® KendoReact DatePicker</td>
		</tr>
	</tbody>
</table>

## Description

How can I add custom buttons in the DatePicker popup for quick date selection (such as "Today" or "Next Week") while ensuring the popup behaves correctly—staying open when interacting with custom buttons but closing when clicking outside?

This knowledge base article also answers the following questions:

* How to add custom buttons in the KendoReact DatePicker popup?
* How to handle focus and blur events properly in DatePicker with custom popup?
* How to keep the popup open when interacting with custom buttons?
* How to use React Context to manage DatePicker values from custom components?
* How to implement quick date selection functionality?

## Solution

To add custom buttons in the DatePicker popup with proper focus handling, you need to:

1. **Create a custom Popup component** using the `popup` property of the DatePicker
2. **Use React Context** for communication between custom buttons and the main component
3. **Handle focus/blur events** properly using the `useAsyncFocusBlur` hook from `@progress/kendo-react-common`
4. **Manage popup state** through DatePicker's event handlers

The following example demonstrates a complete implementation:

[Demo Source](https://demos.telerik.com/kendo-react-ui/knowledge-base/dateinputs/datepicker-custom-popup-buttons/source.txt)

## See Also

* [KendoReact DatePicker Documentation](https://www.telerik.com/kendo-react-ui/components/dateinputs/datepicker)
* [DatePicker Custom Popup](https://www.telerik.com/kendo-react-ui/components/dateinputs/datepicker/custom-rendering)
* [KendoReact Popup Component](https://www.telerik.com/kendo-react-ui/components/popup)
* [useAsyncFocusBlur Hook](https://www.telerik.com/kendo-react-ui/components/common/api/useasyncfocusblur)
* [React Context Documentation](https://react.dev/reference/react/useContext)
