1.1.0 • Published 7 months ago

rn-input-libary v1.1.0

Weekly downloads
-
License
ISC
Repository
github
Last release
7 months ago

rn-input-libary

'rn-input-library' is a versatile and customizable React Native component library designed to streamline mobile development. It offers a set of reusable, props-driven UI components that can be easily integrated and styled to meet a wide variety of mobile application requirements. The library is lightweight, flexible, and highly extendable, making it a great solution for developers looking to enhance their mobile apps with efficient and scalable UI elements.

RnView

RnView is a highly customizable wrapper around the standard View component in React Native, designed to make it easier to apply layout and styling properties, especially for common patterns like padding, margin, flexbox layout (row and col), and alignment (justifyCenter, justifyStart, etc.). It simplifies using these properties in your app by passing them as props, and it applies the necessary styles to the View component based on those props.

Example

<RnView
     row={true}
     justifyCenter={true}
     justifyStart={false}
     justifyEnd={false}
     justifyBetween={false}
     col={false}
     full
     border
     padding
     paddingHorizontal={20}
     paddingVertical={30}
     paddingTop={10}
     paddingBottom={10}
     paddingLeft={5}
     paddingRight={5}
     margin
     marginHorizontal={15}
     marginVertical={25}
     marginTop={10}
     marginBottom={10}
     marginLeft={10}
     marginRight={10}
   >
     <Text>Hello, World!</Text>
   </RnView>

Properties

PropTypeDescriptionMandatoryDefault Value
rowbooleanDefines a horizontal layout. If true, the children of the View will be displayed in a row (horizontal).NoFALSE
colbooleanDefines a vertical layout. If true, the children of the View will be displayed in a column (vertical).NoFALSE
justifyCenterbooleanCenters the children of the View along the main axis (horizontal for row, vertical for col).NoFALSE
justifyStartbooleanAligns the children of the View to the start of the main axis (horizontal for row, vertical for col).NoFALSE
justifyEndbooleanAligns the children of the View to the end of the main axis (horizontal for row, vertical for col).NoFALSE
justifyBetweenbooleanDistributes the children of the View evenly along the main axis with space between them.NoFALSE
paddingbooleannumberApplies padding to all sides. If true, it applies the default padding value. If a number is passed, it applies that value as padding.10
paddingHorizontalbooleannumberApplies horizontal padding (left and right). If true, it applies the default padding. If a number is passed, it applies that value.10
paddingVerticalbooleannumberApplies vertical padding (top and bottom). If true, it applies the default padding. If a number is passed, it applies that value.10
paddingTopbooleannumberApplies padding to the top side. If true, it applies the default padding. If a number is passed, it applies that value.10
paddingBottombooleannumberApplies padding to the bottom side. If true, it applies the default padding. If a number is passed, it applies that value.10
paddingLeftbooleannumberApplies padding to the left side. If true, it applies the default padding. If a number is passed, it applies that value.10
paddingRightbooleannumberApplies padding to the right side. If true, it applies the default padding. If a number is passed, it applies that value.10
marginbooleannumberApplies margin to all sides. If true, it applies the default margin value. If a number is passed, it applies that value as margin.10
marginHorizontalbooleannumberApplies horizontal margin (left and right). If true, it applies the default margin. If a number is passed, it applies that value.10
marginVerticalbooleannumberApplies vertical margin (top and bottom). If true, it applies the default margin. If a number is passed, it applies that value.10
marginTopbooleannumberApplies margin to the top side. If true, it applies the default margin. If a number is passed, it applies that value.10
marginBottombooleannumberApplies margin to the bottom side. If true, it applies the default margin. If a number is passed, it applies that value.10
marginLeftbooleannumberApplies margin to the left side. If true, it applies the default margin. If a number is passed, it applies that value.10
marginRightbooleannumberApplies margin to the right side. If true, it applies the default margin. If a number is passed, it applies that value.10
borderbooleanAdds a border around the View. If true, the border defined in commonStyles.border is applied.NoFALSE
fullbooleanMakes the View occupy the full available space (100% width and height). If true, the View will stretch to fill its container.NoFALSE

RnText

RnText is a customizable text component built on top of the standard Text component in React Native. It provides several props to easily manage common text styling needs such as font weight, alignment, padding, margin, and special text styles like note, title, and banner. This component supports a wide range of customization options that allow you to apply padding, margin, font weight, and more to your text content.

Example

<RnText
     fontWeight={600}
     italic
     note={false}
     title
     textAlignCenter
     padding
     paddingHorizontal={20}
     paddingVertical={15}
     margin
     marginTop={10}
     marginLeft={15}
     style={styles.customStyle}
   \>
     Hello, React Native!
   </RnText\>

Properties

PropTypeDescriptionMandatoryDefault Value
italicbooleanApplies italic style to the text.NoFALSE
notebooleanIf true, sets a smaller font size suitable for notes.NoFALSE
lightbooleanIf true, applies a light text color.NoFALSE
titlebooleanIf true, applies styles suitable for a title, like a larger font size and different color.NoFALSE
bannerbooleanIf true, applies special font styles for a banner, such as a different font family.NoFALSE
textAlignCenterbooleanIf true, aligns the text to the center horizontally.NoFALSE
textAlignLeftbooleanIf true, aligns the text to the left.NoFALSE
textAlignRightbooleanIf true, aligns the text to the right.NoFALSE
fullbooleanIf true, allows the text to take up the full available space (100% width).NoFALSE
paddingbooleannumberIf true, applies padding to all sides. If a number is passed, it applies that value as padding.10
paddingHorizontalbooleannumberIf true, applies horizontal padding (left and right). If a number is passed, it applies that value.10
paddingVerticalbooleannumberIf true, applies vertical padding (top and bottom). If a number is passed, it applies that value.10
paddingTopbooleannumberIf true, applies padding to the top side. If a number is passed, it applies that value.10
paddingBottombooleannumberIf true, applies padding to the bottom side. If a number is passed, it applies that value.10
paddingLeftbooleannumberIf true, applies padding to the left side. If a number is passed, it applies that value.10
paddingRightbooleannumberIf true, applies padding to the right side. If a number is passed, it applies that value.10
marginbooleannumberIf true, applies margin to all sides. If a number is passed, it applies that value as margin.10
marginHorizontalbooleannumberIf true, applies horizontal margin (left and right). If a number is passed, it applies that value.10
marginVerticalbooleannumberIf true, applies vertical margin (top and bottom). If a number is passed, it applies that value.10
marginTopbooleannumberIf true, applies margin to the top side. If a number is passed, it applies that value.10
marginBottombooleannumberIf true, applies margin to the bottom side. If a number is passed, it applies that value.10
marginLeftbooleannumberIf true, applies margin to the left side. If a number is passed, it applies that value.10
marginRightbooleannumberIf true, applies margin to the right side. If a number is passed, it applies that value.10

RnButton

RnButton is a customizable button component built on top of React Native’s TouchableOpacity. It provides a variety of styling and functional props to handle button size, appearance, icon placement, and user interaction. This component is designed to be flexible, allowing you to create buttons with custom themes, icons, padding, margins, and text styles.

Example

<RnButton
     text="Submit"
     primary
     large
     iconLeft={<Icon name="check" />}
     padding
     marginVertical={10}
     onPress={() => console.log('Button Pressed')}
   />

Properties

PropTypeDescriptionMandatoryDefault Value
textstringThe text to display inside the button.No""
textStylesTextStyleCustom styles to apply to the button's text.No{} (empty object)
largebooleanIf true, applies a large size to the button (larger padding, font size, height).NoFALSE
smallbooleanIf true, applies a small size to the button (smaller padding, font size, height).NoFALSE
transparentbooleanIf true, makes the button transparent (no background color).NoFALSE
outlinebooleanIf true, makes the button an outline (border with no background color).NoFALSE
iconLeftJSX.ElementCustom icon component to display on the left side of the button.Nonull
iconRightJSX.ElementCustom icon component to display on the right side of the button.Nonull
iconJSX.ElementCustom icon to be displayed within the button.Nonull
primarybooleanIf true, applies the primary theme to the button (background, border, text color).NoFALSE
secondarybooleanIf true, applies the secondary theme to the button.NoFALSE
warningbooleanIf true, applies the warning theme to the button.NoFALSE
successbooleanIf true, applies the success theme to the button.NoFALSE
dangerbooleanIf true, applies the danger theme to the button.NoFALSE
neutralbooleanIf true, applies a neutral theme to the button.NoFALSE
justifyStartbooleanIf true, aligns the button content to the left.NoFALSE
justifyEndbooleanIf true, aligns the button content to the right.NoFALSE
justifyBetweenbooleanIf true, applies space-between alignment to the button's content (spacing between elements inside).NoFALSE
paddingbooleannumberIf true, applies padding to all sides. If a number is passed, applies that value as padding to all sides.No
paddingHorizontalbooleannumberIf true, applies padding to the left and right sides. If a number is passed, applies that value as horizontal padding.No
paddingVerticalbooleannumberIf true, applies padding to the top and bottom sides. If a number is passed, applies that value as vertical padding.No
paddingTopbooleannumberIf true, applies padding to the top side. If a number is passed, applies that value to the top side.No
paddingBottombooleannumberIf true, applies padding to the bottom side. If a number is passed, applies that value to the bottom side.No
marginbooleannumberIf true, applies margin to all sides. If a number is passed, applies that value as margin to all sides.No
marginHorizontalbooleannumberIf true, applies margin to the left and right sides. If a number is passed, applies that value as horizontal margin.No
marginVerticalbooleannumberIf true, applies margin to the top and bottom sides. If a number is passed, applies that value as vertical margin.No
marginTopbooleannumberIf true, applies margin to the top side. If a number is passed, applies that value to the top side.No
marginBottombooleannumberIf true, applies margin to the bottom side. If a number is passed, applies that value to the bottom side.No
marginLeftbooleannumberIf true, applies margin to the left side. If a number is passed, applies that value to the left side.No
marginRightbooleannumberIf true, applies margin to the right side. If a number is passed, applies that value to the right side.No
onPress() => voidA function that is called when the button is pressed.Nonull
isActionDonebooleanIf true, it disables the button after the action is completed to prevent multiple presses.NoFALSE
disabledbooleanIf true, disables the button and prevents any interaction with it.NoFALSE

RnIcon

RnIcon is a customizable icon component that allows you to easily use icons from various icon libraries like MaterialIcons, FontAwesome, FontAwesome5, FontAwesome6, Feather, Entypo, EvilIcons, Ionicons, and AntDesign. This component provides several props to manage icon properties such as type, size, and color.This component supports a wide range of customization options, allowing you to choose from multiple icon types and control the size and color of the icon.

Example

<RnIcon
     type="FontAwesome"
     name="home"
     size={30}
     color="blue"
     style={{ margin: 10 }}
   />

Properties:

PropTypeDescriptionMandatoryDefault Value
typeMaterialIcons'"FontAwesome""FontAwesome5""FontAwesome6""Feather""Entypo""EvilIcons""Ionicons""AntDesign'The icon library to use. Available options are MaterialIcons, FontAwesome, FontAwesome5, FontAwesome6, Feather, Entypo, EvilIcons, Ionicons, AntDesign.NoMaterialIcons'
namestringThe name of the icon to display.Yes'
colorstringThe color of the icon.NornConstants.TEXT_COLOR
sizenumberThe size of the icon.NornConstants.ICON_SIZE
styleViewStyleCustom styles to apply to the icon container.No{} (empty object)

RnSearchComponent

RnSearchComponent is a customizable search bar component designed to handle text input and search functionality. It allows users to filter data based on their input and provides options such as displaying a cancel button, customizing search filters, and managing search state. This component supports several customization options to fit different use cases.

Example

<RnnSearchComponent
     searchObject={\[{ name: 'Apple' }, { name: 'Banana' }\]}
     keyFilter={\['name'\]}
     updateState={(filteredData) => console.log(filteredData)}
     title="Search fruits"
     focus={true}
     cancelSearch={() => console.log('Search canceled')}
   />

Properties

PropTypeDescriptionMandatoryDefault Value
searchObjectany[]The data to be filtered based on the search text.No[]
keyFilterstring[]An array of keys used for filtering the searchObject.No[]
updateStateFunctionA function to update the filtered state after search.Noundefined
titlestringPlaceholder text for the search input field.NoSearch'
searchTextstringThe current search text.No'
changeSearchTextFunctionA function called whenever the search text changes.Noundefined
cancelSearchFunctionA function called when the search is canceled.Noundefined
focusbooleanIf true, automatically focuses the search input field.NoFALSE
customSearchFilterFunctionA custom filter function that can be used to filter the data based on custom logic.Noundefined
hideCancelbooleanIf true, hides the cancel button in the search bar.NoFALSE

RnInput

RnInput is a customizable input field component built on top of React Native's TextInput. It supports various features like secure text entry (for passwords), customizable icons, error handling, and additional pre-text support. It also includes options for customizing icon colors, managing focus states, and toggling between different icon types, such as an eye icon for password visibility or a swap icon for special functionality.

Example

<RnInput
     placeholder="Enter your text"
     error="This field is required"
     eyeIcon={true}
     iconColor="gray"
     preText="Pre-text"
     disabled={false}
     multiline={false}
     onChangeText={(text) => console.log(text)}
   />

Properties

PropTypeDescriptionMandatoryDefault Value
errorstringThe error message to display below the input field.Noundefined
preTextstringText to display before the main input text.Noundefined
iconanyThe name of the icon to display inside the input field.Noundefined
multilinebooleanIf true, allows the input to be multiline.NoFALSE
iconColorstringThe color of the icon inside the input field.No#000 (default text color)
eyeIconbooleanIf true, allows toggling between secure text (password) with an eye icon.NoFALSE
swapIconbooleanIf true, adds a swap icon inside the input field.NoFALSE
disabledbooleanIf true, disables the input field.NoFALSE
placeholderTextColorstringThe color of the placeholder text when the input is empty.No#999 (default text color)

RnPicker

RnPicker is a customizable dropdown component that allows users to select from a list of options. It supports a variety of features, such as search filtering, displaying custom render options, validation checks, and a placeholder option. The picker also offers the ability to display a "None" option, toggle visibility via modal, and customize the styling of the dropdown and its text.

Example

<RnPicker
     label="Select Option"
     showLabel={true}
     selectedOption={1}
     data={data}
     onSelect={(item) => console.log(item)}
     placeHolder="Please select"
     required={true}
   />

Properties

PropTypeDescriptionMandatoryDefault Value
labelstringThe label displayed above the picker.Yesundefined
showLabelbooleanControls whether the label should be shown above the picker.YesTRUE
pickerStylesStylePropCustom styles for the picker container.Noundefined
pickerTextStylesStylePropCustom styles for the picker text inside the dropdown.Noundefined
selectedOptionstringnumberThe value of the selected option in the picker.Yes
dataRnPickerOption[]Array of options to be displayed in the picker.Yes[]
disabledbooleanIf true, disables the picker.NoFALSE
onSelect(item: RnPickerOption & { index?: number }) => voidCallback function invoked when an option is selected.Yesundefined
requiredbooleanIf true, marks the picker as required for validation purposes.NoFALSE
triggerValidationbooleanIf true, triggers validation for the selected option (used with required).NoFALSE
placeholderstringThe placeholder text to display when no option is selected.Noundefined
customOptionRender(item, index) => JSX.ElementCustom render function for each option in the list.Noundefined
showModalbooleanIf true, shows the options in a modal dialog.NoTRUE
hideSearchbooleanIf true, disables the search bar inside the dropdown modal.NoFALSE
arrowColorstringThe color of the dropdown arrow icon.No
showNoneOptionbooleanIf true, adds a "None" option at the beginning of the picker list.NoFALSE
changeSearchTextFunctionCallback to handle the change in search text when filtering options.Noundefined
Picker Options
PropTypeDescriptionMandatoryDefault Value
valuestringnumberThe value of the option.Yes
labelstringnumberThe label of the option.No
colorstringThe color of the option, typically used for highlighting.Noundefined
hidebooleanIf true, hides the option from the dropdown list.NoFALSE
idstringUnique identifier for the option.Noundefined
extraDatastringAdditional data associated with the option.Noundefined
checkedstringMarks the option as checked if necessary.Noundefined
dataT (Generic)TAdditional data for the option, where T is a generic type.Noundefined

RnMultiSelect

RnMultiSelect is a customizable multi-select dropdown component for React Native. It allows users to select multiple options from a list, with support for search functionality, custom option rendering, and modal management. It also provides features like displaying selected options at the top, validating required selections, and customizing the appearance of the dropdown.

Example

<RnMultiSelect
       label="Select Options"
       options={options}
       showSelectedTop={true}
       onChange={(selectedOptions) => console.log(selectedOptions)}
       selectedValues="Option 1, Option 3"
     />

Properties

PropTypeDescriptionMandatoryDefault Value
labelstringThe label to display for the multi-select dropdown.YesN/A
optionsRnMutliSelectOption[]List of options to display in the dropdown. Each option should be an object containing name and id properties.YesN/A
disabledbooleanDisables the dropdown if set to true.NoFALSE
showSelectedTopbooleanIf true, displays selected items at the top of the options list.NoTRUE
requiredbooleanIf true, indicates that the selection is required (can trigger validation).NoFALSE
triggerValidationbooleanIf true, triggers validation when the dropdown is used.NoFALSE
selectedValuesstringA comma-separated string of selected option names to display initially in the input box.No"" (empty string)
closeFunctionFunctionA callback function to close the multi-select modal when invoked.Noundefined
inputBoxStylesViewStyleCustom styles for the input box that opens the modal.Noundefined
customOptionRender(item, index) => JSX.ElementA function to render each option with custom JSX (allows customizing the option display).Noundefined
onChangeFunctionFunctionA callback function triggered when the selection changes. It receives the selected items as input.Noundefined
onClickFunctionFunctionA callback function triggered when the dropdown button is clicked.Noundefined
changeSearchTextFunctionA callback function triggered when the search text is changed.Noundefined
RnMultiSelectOption

RnMutliSelectOption = {  
name: string,    id: string,    selected?: boolean,    disabled?: boolean,    isLabel?: boolean    tagColor?: string }


RnCheckbox

RnCheckbox is a customizable checkbox component for React Native, allowing users to select or deselect options. It supports various customization features such as size, color, border styling, and display of validation messages. It is fully accessible for form usage with built-in support for required validation.

Example

     <RnCheckbox
       label="Agree to terms"
       checked={checked}
       onChange={handleCheckboxChange}
       required={true}
       disabled={false}
       size={24}
       checkBoxCheckedColor="green"
       checkBoxUnCheckedBorderColor="gray"
     />

Properties

PropTypeDescriptionMandatoryDefault Value
labelstringThe label to display next to the checkbox.NoN/A
sizenumberThe size of the checkbox.No20
checkedbooleanIndicates whether the checkbox is checked or not.NoFALSE
disabledbooleanDisables the checkbox if set to true.YesN/A
circlebooleanIf true, the checkbox will be circular, else it will have a square shape.YesFALSE
onChange(checked: boolean) => voidCallback function triggered when the checkbox is toggled.YesN/A
stylesTouchableOpacityProps'style'Custom styles for the checkbox container.Noundefined
requiredbooleanIf true, indicates that the checkbox is required (used for validation purposes).NoFALSE
triggerValidationbooleanIf true, triggers validation when the checkbox is required but not checked.NoFALSE
checkBoxCheckedColorstringThe color of the checkmark when the checkbox is checked.NornConstants.SECONDARY_COLOR
checkBoxCheckedFilledColorstringThe background color of the checkbox when checked.NornConstants.TRANSPARENT_COLOR
checkBoxUnCheckedFilledColorstringThe background color of the checkbox when unchecked.NornConstants.TRANSPARENT_COLOR
checkBoxUnCheckedBorderColorstringThe border color of the checkbox when unchecked.NornConstants.SECONDARY_COLOR
checkBoxCheckedBorderColorstringThe border color of the checkbox when checked.NornConstants.PRIMARY_COLOR

RnCheckboxGroup

RnCheckboxGroup is a customizable group of checkboxes for React Native that allows users to select one option from a list. It supports features such as custom labels, required validation, and dynamic state updates. The group can be customized with different fields and values, offering flexibility in form design.

Example

<RnCheckboxGroup
       value={selectedValue}
       label="Choose your option"
       fields={\[
         { label: "Option 1", value: "option1" },
         { label: "Option 2", value: "option2" },
         { label: "Option 3", value: "option3" }
       \]}
       required={true}
       disable={false}
       onChange={handleCheckboxGroupChange}
     />

Properties

PropTypeDescriptionMandatoryDefault Value
valuestringThe currently selected value from the checkbox options.YesN/A
labelstringThe label to display above the group of checkboxes.NoN/A
fieldsRnPickerOption[]An array of options for the checkbox group. Each option should contain a label and value.YesN/A
disabledbooleanDisables the entire checkbox group if true.YesFALSE
requiredbooleanIf true, marks the checkbox group as required for validation purposes.YesFALSE
onChange(value: string) => voidCallback function that is triggered when the selected value changes.YesN/A

CheckBox Type:

PropTypeDescriptionMandatoryDefault Value
labelstringThe label text to display next to the checkbox.YesN/A
valuestringThe unique value for the checkbox.YesN/A
isSelectedbooleanWhether the checkbox is currently selected or not.YesN/A

RnChip

RnChip is a customizable component for displaying small, interactive elements such as tags or labels. It allows for icons on either side, customizable text, heading, and the ability to delete the chip. The chip can be styled with a custom color and border radius.

Example

 <RnChip
       text="Sample Chip"
       heading="Chip Heading"
       onDelete={handleDelete}
       iconLeft={<MaterialIcons name="remove-circle" size={20} />}
       iconRight={<MaterialIcons name="close" size={20} />}
       chipColor="#E0E0E0"
       radius={12}
     />

Properties

PropTypeDescriptionMandatoryDefault Value
textstringThe main text displayed inside the chip.YesN/A
textStyleTextStyleCustom styles for the text inside the chip.NoN/A
headingstringOptional heading to display above the chip text.NoN/A
headingStyleTextStyleCustom styles for the heading text.NoN/A
iconLeftJSX.ElementOptional icon to display on the left side of the chip.NoN/A
iconRightJSX.ElementOptional icon to display on the right side of the chip.NoN/A
onDeleteFunctionOptional callback function when the delete icon is pressed.NoN/A
radiusnumberThe border radius of the chip, allowing for rounded corners.NornConstants.CHIP_RADIUS
keyPropnumberA unique key for the chip component.NoN/A
typestringAn optional type to categorize the chip (e.g., "info", "warning").NoN/A
chipColorstringCustom background color for the chip.NornConstants.LIGHT_PRIMARY_COLOR

RnProgressBar

RnProgressBar is a simple component that displays a horizontal progress bar. It allows you to visually track the completion of a task by filling the progress bar based on the provided progress value.

Example

<RnProgressBar progress={0.5} />

Properties

PropTypeDescriptionMandatoryDefault Value
progressnumberThe progress value, where 0 is 0% completion and 1 is 100%.No0

RnSlider

RnSlider is a component that allows users to interact with a range of values. It supports both single and range sliders with adjustable boundaries and initial values.

Example

     <RnSlider
       minBoundary={0} maxBoundary={99}
       min\_initVal={12} max\_initVal={88}
       rangeSlider={true}
       onValueChange={(data: { minValue: number, maxValue: number }) => {
         console.log("Selected Range:", data)
       }}
     />

Properties

PropTypeDescriptionMandatoryDefault Value
minBoundarynumberThe minimum boundary of the slider.No0
maxBoundarynumberThe maximum boundary of the slider.YesN/A
min_initValnumberThe initial value for the minimum slider.No0
max_initValnumberThe initial value for the maximum slider.YesN/A
rangeSliderbooleanIf true, the slider allows selecting a range (min and max values).YesN/A
onValueChange(data: { minValue: number, maxValue: number }) => voidCallback function that returns the selected range of values.NoN/A

RnDatePicker

RnDatePicker is a customizable date picker component that allows users to select single dates or ranges, with various customization options including color schemes, date disabling, pinned dates, and more. It supports both dialog and sheet types, making it flexible for different use cases.

Example

<RnDatePicker
       selectedOrStartDate={selectedDate}
       onChange={handleDateChange}
       disable={false}
       dateRange={false}
       pinnedDates={{
         "2024-11-25": {
           color: "red",
           events: \[{ title: "Event 1", description: "Description of event 1" }\]
         }
       }}
       primaryColor="#FF6347"
       secondaryColor="#FFFFFF"
     />

properties

PropTypeDescriptionMandatoryDefault Value
type'dialog' | sheet'The type of date picker, either a dialog or a sheet.No
alignItem'center' | end'Controls the alignment of the date picker. Can be 'center' or 'end'.No
calendarStyles{ key: string: any }Custom styles for the calendar.No{}
onChangeFunctionCallback function to handle date changes. Receives the selected date as a parameter.YesN/A
selectedOrStartDatestringDateThe selected date or the start date for date range selection.Yes
disabledbooleanIf true, disables the date picker.YesFALSE
calendarInputStyles{ key: string: any }Custom styles for the input field of the calendar.No{}
primaryColorstringThe primary color for the calendar.Noundefined
secondaryColorstringThe secondary color for the calendar.Noundefined
dateRangebooleanIf true, the date picker will allow selecting a range of dates.YesFALSE
disableBeforeDaysbooleanIf true, disables dates before the selected date.YesFALSE
disableAfterDaysbooleanIf true, disables dates after the selected date.YesFALSE
minDateToDisablestringDateThe minimum date to disable. Can be a string (e.g., "YYYY-MM-DD") or a Date object.No
maxDateToDisablestringDateThe maximum date to disable. Can be a string (e.g., "YYYY-MM-DD") or a Date object.No
endDatestringDateThe end date for date range selection.No
pinnedDates{ key: string: { color?: string, events: { title: string, description: string }[] } }A list of pinned dates with optional events and colors. The key should be in the format "YYYY-MM-DD".Yes{}
monthPickerbooleanIf true, the picker will only allow month and year selection.NoFALSE
startDateChangeDetectbooleanIf true, triggers the onChange function when the start date is selected (for range date picker).NoFALSE
showDateRangeLabelbooleanIf true, shows a label indicating the selected date range.NoFALSE
highlightedbooleanIf true, highlights the selected date.NoFALSE
showModalbooleanIf true, displays the modal for date selection.NoTRUE
dateRangeSeparatorstringThe separator for the start and end dates in date range mode.No- '
dateStyles{ key: string: any }Custom styles for specific dates (e.g., pinned dates).No{}
calendarIconColorstringThe color for the calendar icon.Noundefined
onCloseFunctionCallback function that is called when the date picker modal is closed.Noundefined
formatDatestringThe format in which the date will be displayed.Noundefined

RnTimePicker

RnTimePicker is a customizable time picker component that allows users to select a specific time. It includes options for styling the input box, validation triggers, and the picker icon color.

Example

<RnTimePicker
       label="Select Time"
       initialTime={selectedTime}
       onChange={handleTimeChange}
       required={true}
       pickerIconColor="#FF6347"
     />

Properties

PropTypeDescriptionMandatoryDefault Value
labelstringThe label displayed next to the time picker input field.YesN/A
initialTimestringThe initial time value displayed in the input field (in 12-hour format, e.g., "12:00 PM").YesN/A
onChangeFunctionA callback function that is triggered when the selected time changes. Receives the updated time as a string.YesN/A
inputBoxStylesViewStyleCustom styles for the input box where the time is displayed.No{}
requiredbooleanIf true, marks the time picker as a required field, typically used in form validation.NoFALSE
triggerValidationbooleanIf true, triggers validation when the time is selected.NoFALSE
disablebooleanIf true, disables the time picker, making it non-interactive.NoFALSE
pickerIconColorstringThe color of the icon displayed next to the time picker input.Noundefined