--- title: DatePicker description: >- The `DatePicker` component allows merchants to select a specific date using a calendar-like picker interface. Use it to provide visual date selection with an intuitive calendar view for improved user experience. `DatePicker` offers a calendar-based alternative to direct text input. The calendar interface allows merchants to see dates in context of the full month, making it easier to select dates relative to specific days of the week or to visualize date ranges within a month view. For simple date entry when users know the exact date, use `DateField`. api_version: 2024-04 api_name: pos-ui-extensions source_url: html: >- https://shopify.dev/docs/api/pos-ui-extensions/latest/ui-components/forms/datepicker md: >- https://shopify.dev/docs/api/pos-ui-extensions/latest/ui-components/forms/datepicker.md --- # Date​Picker The `DatePicker` component allows merchants to select a specific date using a calendar-like picker interface. Use it to provide visual date selection with an intuitive calendar view for improved user experience. `DatePicker` offers a calendar-based alternative to direct text input. The calendar interface allows merchants to see dates in context of the full month, making it easier to select dates relative to specific days of the week or to visualize date ranges within a month view. For simple date entry when users know the exact date, use `DateField`. ### Support Targets (2) ### Supported targets * [pos.​home.​modal.​render](https://shopify.dev/docs/api/pos-ui-extensions/2024-04/targets/home-screen#home-screen-action-modal-) * [pos.​purchase.​post.​action.​render](https://shopify.dev/docs/api/pos-ui-extensions/2024-04/targets/post-purchase#post-purchase-action-modal-) #### Use cases * **Visual selection:** Provide visual date selection with calendar context for scheduling workflows. * **Quick selection:** Enable quick date selection for filtering reports or analytics. * **Touch-optimized:** Support touch-optimized date input where tapping is more efficient than typing. * **Modal pickers:** Implement modal-style date pickers that can be shown or hidden programmatically. ## Examples ### Select dates with a calendar picker Provide an interactive calendar interface for date selection. This example demonstrates implementing a DatePicker component with state management and selection handling, offering users a visual calendar interface for choosing dates instead of manual text entry. ## Select dates with a calendar picker ![](https://cdn.shopify.com/shopifycloud/shopify-dev/development/assets/assets/images/templated-apis-screenshots/pos-ui-extensions/2024-04/date-picker-default-SCacg3MA.png) ### Examples * #### Select dates with a calendar picker ##### Description Provide an interactive calendar interface for date selection. This example demonstrates implementing a DatePicker component with state management and selection handling, offering users a visual calendar interface for choosing dates instead of manual text entry. ##### React ```tsx import React, {useState} from 'react'; import { Button, DatePicker, Screen, Text, reactExtension, } from '@shopify/ui-extensions-react/point-of-sale'; const SmartGridModal = () => { const [date, setDate] = useState( new Date().toDateString(), ); const visibleState = useState(false); return ( Selected date: {date}