Skip to main content

NeoPopDatePicker

An inline scroll-wheel date picker with day, month, and year columns, configurable date bounds, and haptic feedback.

Usage

// dark mode example
import { NeoPopDatePicker } from 'neopop-rn';
import { useState } from 'react';

function Example() {
const [date, setDate] = useState(new Date());

return (
<NeoPopDatePicker
value={date}
minDate={new Date('2000-01-01')}
maxDate={new Date('2030-12-31')}
colorMode="dark"
enableHaptics
onDateChange={setDate}
/>
);
}
// light mode example
import { NeoPopDatePicker } from 'neopop-rn';

<NeoPopDatePicker
defaultValue={new Date('1990-06-15')}
colorMode="light"
colorConfig={{
background: '#ffffff',
textColor: '#0d0d0d',
selectedTextColor: '#ffffff',
selectedBackground: '#0d0d0d',
separatorColor: '#cccccc',
}}
onDateChange={(date) => console.log(date.toISOString())}
/>

Props

PropTypeDefaultDescription
valueDateControlled date value.
defaultValueDateInitial date for uncontrolled usage.
minDateDateEarliest selectable date (inclusive).
maxDateDateLatest selectable date (inclusive).
onDateChange(date: Date) => voidCalled whenever the selected date changes.
enableHapticsbooleanFires a selection haptic when the date changes.
colorConfigNeoPopDatePickerColorConfigPer-token color overrides (see colorConfig table).
colorMode'dark' | 'light'Theme mode for default colors.
styleStyleProp<ViewStyle>Additional style applied to the outer container.

colorConfig

KeyDescription
backgroundBackground color of the picker container.
textColorDefault text color for unselected rows.
selectedTextColorText color of the selected row.
selectedBackgroundBackground highlight color of the selected row.
separatorColorColor of the top and bottom separator lines flanking the selected row.

Notes

  • The picker renders three independent scroll columns: day, month, and year. Scrolling one column does not reset the others.
  • minDate and maxDate constrain each column independently; invalid combinations (e.g., February 31) are excluded from the scrollable items.
  • When both value and defaultValue are omitted, the picker initialises to the current date.
  • Controlled mode (value) requires the parent to update the prop via onDateChange; failure to do so will cause the picker to snap back to value after each scroll.