npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

react-native-customdob

v1.1.1

Published

date of birth input

Readme

DOBPicker

DOBPicker is a customizable Date of Birth picker component for React Native, built using react-native-paper and react-native-modal-datetime-picker. It allows users to select a date and time using a modal date picker, with additional support for custom icons and text input handling.

Installation

Ensure you have react-native-paper and react-native-modal-datetime-picker installed in your project. If not, install them first:

npm install react-native-paper react-native-modal-datetime-picker date-fns

Then, install DOBPicker by adding it to your project:

npm install react-native-customtextinput

Usage

Import and use the DOBPicker component in your React Native project:

import React, { useState } from 'react';

import { View, Image } from 'react-native';

import DOBPicker from 'react-native-customtextinput';

const App = () => {

const [selectedDate, setSelectedDate] = useState<Date | undefined>();

return (

<View style={{ padding: 20 }}>

  <DOBPicker
    label="Date of Birth"
    onDateChange={handleDateChange}
    dateFormat="yyyy-MM-dd"
    calendarIcon={require('./assets/calendar.png')}
    clearIcon={require('./assets/clear.png')}
    rightCalendarIconStyle={{ width: 30, height: 30, tintColor: 'blue' }}
    Icon={require('./assets/user.png')}
    leftIconStyle={{ width: 25, height: 25, tintColor: 'green' }}
  />
  
</View>

); };

export default App;

Props

| Prop Name | Type | Default | Description | |-----------------------|------------------------------------|-----------------------|---------------------------------------------------------------| | label | string | undefined | Label for the text input field. | | value | string | undefined | The value displayed in the input field. | | Icon | ImageSourcePropType | undefined | Optional left-side icon. | | calendarIcon | ImageSourcePropType | Required | Calendar icon for the date picker. | | clearIcon | ImageSourcePropType | undefined | Clear icon to reset the selected date. | | onDateChange | (selectedDate: Date / undefined) => void | Required | Callback when the date is selected or cleared. | | dateFormat | string | 'dd/MM/yyyy h:mm' | Format for displaying the selected date. | | onClear | () => void | undefined | Callback when the clear button is pressed. | | returnKeyType | 'done' / 'next' | undefined | Return key type for the keyboard. | | onSubmitEditing | () => void | undefined | Callback when submitting the input field. | | forwardRef | Ref<RNTextInput> | undefined | Forwarded reference to the input field. | | textColor | string | 'black' | Color of the text in the input field. | | placeholderTextColor| string | 'black' | Color of the placeholder text. | | mode | 'flat' / 'outlined' | 'outlined' | Mode of the TextInput component from react-native-paper. | | rightCalendarIconStyle| StyleProp<ImageStyle> | undefined | Style for the right calendar/clear icon. | | leftIconStyle | StyleProp<ImageStyle> | undefined | Style for the left icon. | | datetimeMode | 'date' / 'time' / 'datetime' | 'datetime' | Mode for the DateTimePickerModal (date, time, or datetime). |

Features

Displays a modal date and time picker.

Customizable icons for calendar and clear actions.

Prevents direct text input to ensure valid date selection.

Uses date-fns for date formatting and parsing.

Supports React Native Paper's theming.