react-native-picker-weekday
TypeScript icon, indicating that this package has built-in type declarations

1.1.2 • Public • Published

WeekDay Picker

Simple Customizable Weekday Picker for react native and Expo.

  • Steps to use
    • npm i react-native-picker-weekday
import * as React from 'react'
import { StyleSheet } from 'react-native'
import { DayPicker } from 'react-native-picker-weekday'
const SampleApp = () => {
  const [weekdays, setWeekdays] = React.useState([-1])
  return (
    <DayPicker
      weekdays={weekdays}
      setWeekdays={setWeekdays}
      activeColor='violet'
      textColor='white'
      inactiveColor='grey'
    />

    /*
    optional parameters include
    dayTextStyle - All styles applicable to text component
    itemStyles - All Styles applicable to View component
    wrapperStyles - All Styles applicable to View component

    This gives high flexibility over Visiblity and Styling of this component.

    */
  )
}
  • Uses a number[] type React State.
  • Simple created by setting initial state to [-1] dont pick 1-7
  • Pass the state and StateSetter to see the selected components.
  • State list intially will have [-1] then state change will contain numbers 1-7 (sunday-saturday) as per selection.

package

Package Sidebar

Install

npm i react-native-picker-weekday

Weekly Downloads

13

Version

1.1.2

License

MIT

Unpacked Size

23.4 kB

Total Files

15

Last publish

Collaborators

  • saliksayyed