Expo

DocyFieldDateRange

Date range picker form field with start/end selector using native date picker.

iOSAndroid
Preview DocyFieldDateRange on your device

Scan with Expo Go

Download Expo Go, then scan the QR code to preview native components.

Overview

DocyFieldDateRange provides a start and end date picker. On iOS it uses an ActionSheet with tab-based Start/End switching; on Android it opens sequential native date picker dialogs.

Installation

pnpm dlx @docyrus/cli add @docyrus/rn-form-fields
# Required: @react-native-community/datetimepicker
npx expo install @react-native-community/datetimepicker
Required Packages(1 package)
pnpm add @react-native-community/datetimepicker

Usage

import { DocyFieldDateRange } from '@/components/docyrus-native/form-fields/docy-field-date-range';

const [range, setRange] = useState<{
  startDate: Date | null;
  endDate: Date | null;
}>({ startDate: null, endDate: null });

<DocyFieldDateRange
  name="vacation"
  label="Vacation Period"
  value={range}
  onChange={setRange}
  dateFormat="long"
  clearable
/>

API Reference

PropTypeDefaultDescription
valueDocyFieldDateRangeValue{ startDate: null, endDate: null }Start and end dates
onChange(value: DocyFieldDateRangeValue) => void—Called when value changes
onBlur() => void—Blur handler
onFocus() => void—Focus handler
minimumDateDate—Minimum selectable date
maximumDateDate—Maximum selectable date
dateFormat'short' | 'medium' | 'long' | 'full''medium'Date format preset
formatstring—Custom date pattern
separatorstring' – 'Separator between start and end display
clearablebooleantrueShow clear button
allowSameDatebooleantrueAllow start and end to be the same date
calendarIconReactNode—Custom calendar icon
clearIconReactNode—Custom clear icon
iconSizenumber20Icon size in pixels
iconColorstring—Icon color override

Inherits all DocyFieldBaseProps (name, label, placeholder, helpText, required, disabled, readOnly, error, size, variant, etc.)

Platform Behavior

PlatformBehavior
iOSActionSheet with Start/End tabs + spinner picker
AndroidSequential native date picker dialogs
WebFallback message (native picker not available)

Type Exports

TypeDescription
DocyFieldDateRangeValue{ startDate: Date | null; endDate: Date | null }
DocyFieldDateRangePropsProps for DocyFieldDateRange component

Compatibility

PlatformSupport
Expo GoYes
Dev ClientYes
Bare RNYes (auto-linked)

On this page