React Native Date Picker offers two ways to display the picker: using the built-in modal or rendering it inline within your layout.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/henninghall/react-native-date-picker/llms.txt
Use this file to discover all available pages before exploring further.
Modal Picker
The built-in modal provides a pre-configured overlay that handles opening, closing, and user interactions with confirm/cancel buttons.When to Use Modal
Use the modal picker when:- You want a quick, out-of-the-box solution
- You need a standard modal overlay experience
- You want built-in confirm/cancel actions
- You prefer minimal code for common use cases
Basic Modal Example
Required Modal Props
When usingmodal={true}, you must also provide:
open- Boolean controlling modal visibilityonConfirm- Callback when user confirms the selectiononCancel- Callback when user cancels or closes the modal
Modal-Only Props
These props only work whenmodal={true}:
| Prop | Type | Description |
|---|---|---|
open | boolean | Controls modal visibility |
onConfirm | (date: Date) => void | Called when user confirms |
onCancel | () => void | Called when user cancels or taps outside |
title | string | null | Modal title text (set to null to hide) |
confirmText | string | Custom confirm button text (default: “Confirm”) |
cancelText | string | Custom cancel button text (default: “Cancel”) |
buttonColor | string | Color of confirm/cancel buttons (Android only) |
Customizing Modal Text
Removing Modal Title
Settitle to null to remove the title entirely:
Inline Picker
The inline picker renders directly in your component tree, giving you full control over layout and positioning.When to Use Inline
Use the inline picker when:- You want to build a custom modal or overlay
- You need the picker to be part of your page layout
- You want full control over the surrounding UI
- You’re building a custom form with embedded pickers
Basic Inline Example
Inline-Only Props
When using inline mode (withoutmodal prop):
| Prop | Type | Description |
|---|---|---|
onDateChange | (date: Date) => void | Called when user changes the date/time |
onStateChange | (state: ‘spinning’ | ‘idle’) => void | Tracks spinner state (Android only) |
Building a Custom Modal
You can use the inline picker with your own modal component:Tracking Spinner State
UseonStateChange to track when the picker wheel is spinning (Android inline only):
This prevents users from confirming before the wheel has stopped spinning, ensuring they select the intended date.
Comparison
| Feature | Modal | Inline |
|---|---|---|
| Built-in overlay | Yes | No |
| Confirm/Cancel buttons | Built-in | You implement |
| Custom positioning | No | Yes |
| Custom styling | Limited | Full control |
| Setup complexity | Simple | More control needed |
| Use case | Quick standard modal | Custom layouts/modals |
Choosing Between Modal and Inline
Use Modal When
- You want a standard modal experience
- You need minimal setup
- Built-in confirm/cancel is sufficient
- You prefer the default styling
Use Inline When
- You need custom layout positioning
- You’re building a custom modal
- You want full UI control
- The picker is part of a form