# Date Picker — React Native component for Expo

> A floating-label date field that opens the calendar in a draggable spring sheet.

A date field with a floating label and glowing focus halo that opens the Calendar in a spring sheet (drag the grabber to dismiss, a dialog on wide screens) or an anchored popover. Single or range mode, one-tap presets like Next 7 days and Next weekend, optional Clear / Done staging with a live summary, Intl formatting, error shake with an icon message and a success check.

- Docs: https://expokit.in/docs/components/date-picker
- Tier: Free
- Also called: date picker, date input, birthday picker
- Category: Inputs
- Platforms: iOS, Android, web
- Expo Go: yes, no development build needed
- npm dependencies: react-native-svg
- Uses ExpoKit items: kit, calendar
- Variants: Birthday, Trip Dates, Deadline, Sizes

## Installation

Run once per project: `npx @expokit/cli@latest init` (shared theme + KitProvider). Then:

```bash
npx @expokit/cli@latest add date-picker
```

The CLI copies the source into your project (you own the code) and installs react-native-svg.

Import: `import { DatePicker } from "@/components/ui/date-picker";`

## Props

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `label` | `string` | — | Rests in the field, floats onto the border when open or filled. |
| `floatingLabel` | `boolean` | `true` | Set to false to put the label above the field as static text (no notch) and show placeholder inside. |
| `mode` | `'single' \| 'range'` | `'single'` | One date or a start / end range. |
| `value` | `Date \| { start, end } \| null` | — | Controlled value. |
| `defaultValue` | `Date \| { start, end } \| null` | `null` | Initial value when uncontrolled. |
| `onChange` | `(value) => void` | — | Called with the committed date / range, or null when cleared. |
| `presentation` | `'auto' \| 'sheet' \| 'dialog' \| 'popover'` | `'auto'` | auto: bottom sheet on phones, centred dialog from 640pt wide · sheet: always a bottom sheet with drag-to-dismiss · dialog: always a centred modal · popover: drops under the field. |
| `presets` | `boolean \| { label, value \| () => value }[]` | — | true adds built-in shortcuts (Today, Next 7 days, Next weekend, This month…); or pass your own. |
| `confirm` | `boolean` | `false` | Stage picks behind Clear / Done; otherwise picking (or finishing a range) closes the picker. |
| `clearable` | `boolean` | `false` | Show an × in the field that clears the value. |
| `format` | `(date: Date) => string` | — | Custom formatter for each date shown in the field. |
| `formatOptions` | `Intl.DateTimeFormatOptions` | `{ day, month: 'short', year }` | Intl options for the field text. |
| `locale` | `string` | `device` | Locale for the field and the calendar. |
| `size` | `'sm' \| 'md' \| 'lg'` | `'md'` | Field height 46 / 56 / 66 and type size. |
| `placeholder` | `string` | — | Shown in the field while open with nothing picked, and in the sheet header. |
| `title` | `string` | `label` | Sheet heading. |
| `minDate / maxDate` | `Date` | — | Selectable bounds; presets outside them are disabled. |
| `isDateDisabled` | `(date: Date) => boolean` | — | Disable individual days. |
| `markedDates` | `Record<string, string \| string[]>` | — | Event dots, passed to Calendar. |
| `weekStartsOn` | `0 \| 1` | `0` | First day of the week. |
| `showOutsideDays` | `boolean` | `false` | Show neighbouring-month days in the grid. |
| `error` | `string` | — | Red border, icon message and one shake. |
| `success` | `boolean \| string` | — | Success border and check; a string is shown under the field. |
| `helper` | `string` | — | Hint under the field. |
| `disabled` | `boolean` | `false` | Dims the field and blocks opening. |
| `accent` | `string` | `theme accent` | Focus, halo and selection colour. |
| `surface` | `string` | `theme background` | Background behind the field (the label notch uses it). |
| `onOpenChange` | `(open: boolean) => void` | — | Called when the picker opens or closes. |
| `style` | `StyleProp<ViewStyle>` | — | Root container style. |
| `className` | `string` | — | Tailwind classes on the root when using NativeWind or Uniwind. Prefer style for StyleSheet overrides. |
| `fieldStyle` | `StyleProp<ViewStyle>` | — | The bordered box: background, border width / colour, radius, height, padding. Wins over the computed style; a borderColor replaces the resting border only (focus, error and success colours still show). A numeric height / borderRadius re-centres the label and resizes the halo. |
| `inputStyle` | `StyleProp<TextStyle>` | — | The formatted date text in the trigger. |
| `labelStyle` | `StyleProp<TextStyle>` | — | Label in both modes (floating and above). color is the resting colour — focus (accent), error and success still take over; fontSize sets the resting size, it floats at the same ratio and the notch follows its width. |
| `messageStyle` | `StyleProp<TextStyle>` | — | Helper / error / success text. color applies to the helper; error and success keep their tone colour. |
| `placeholderTextColor` | `string` | `theme mutedForeground` | Placeholder colour in the trigger. |
| `iconColor` | `string` | `theme mutedForeground` | Calendar icon and clear × colour at rest (calendar turns accent while open). |
| `menuStyle` | `StyleProp<ViewStyle>` | — | Sheet / dialog / popover panel — background, border, radius, padding, shadow (transform and opacity are animated). |

## Behaviour & accessibility

- **Touch**: Tap the field to open the picker. In a sheet, drag the grabber header down (or flick it) to dismiss.
- **Motion**: The label floats onto the border and a focus halo springs in while open. An error shakes the field once and its message springs in below.
- **Screen readers**: The field is a button labelled with your label, with the date (or "Not set") as its value and an expanded state. Helper, error and success messages are polite live regions.
- **Platforms**: With presentation 'auto' it opens a bottom sheet on phones and a centred dialog from 640pt wide.

## FAQ

### How do I make a date picker in React Native?

Use ExpoKit's Date Picker: run npx @expokit/cli@latest add date-picker in your Expo or React Native project and it copies a ready-made date picker into your app as plain TypeScript you can edit. It works on iOS, Android and web, and in Expo Go.

### Does Date Picker work in Expo Go?

Yes. Date Picker runs in Expo Go on iOS and Android with no development build — its packages (react-native-svg) are all included in Expo Go.

### How do I add Date Picker to my Expo app?

Run npx @expokit/cli@latest add date-picker in your project. The CLI copies the component's source into your app and installs react-native-svg, so the code is yours to change.

### Is Date Picker free?

Yes. Date Picker is free: its full source is on this page and the CLI installs it without an account.

### Can I change how Date Picker looks?

Yes. It takes its colours, radius and light / dark mode from useKit(), so wrapping your app in <KitProvider accent radius> re-skins it with every other ExpoKit component. The code lives in your project, so you can also edit anything directly.

## More

- Live preview, variants and code: https://expokit.in/docs/components/date-picker
- Every ExpoKit component, screen, template and chart: https://expokit.in/llms.txt
- Install commands and props for every free component: https://expokit.in/llms-full.txt
- Pricing: https://expokit.in/pricing
