1.0.6 • Published 1 month ago

react-native-input-file v1.0.6

Weekly downloads
-
License
MIT
Repository
github
Last release
1 month ago

React native input file

With this library you can attach files in your form Animation

Example

<InputFile
  typeInputFile="button"
  labelButtonStyle={{fontWeight: 'bold'}}
  multiple
  label="+ Attach File"
  previewFiles
  onChange={dataFiles => handleChangeFiles(dataFiles)}
/>

Props

type InputFileProps = {
  selectedFiles?: () => void;
  multiple?: boolean;
  previewFiles?: boolean;
  typeFiles?: 'images' | 'pdf' | 'all';
  copyToCacheDirectory?: boolean;
  onChange?: (dataFiles?: FileSelectedType[]) => void;
  label?: string;
  typeInputFile?: "container" | "button",
  required?: boolean;
  onRemoveFile?: (indexFile: number) => void
  noConcatenation?: boolean;
}

type InputFileContainerProps = {
  typeInputFile: "container";
  containerStyle?: ViewStyle;
  labelContainer?: TextStyle;
} & InputFileProps

type InputFileButtonProps = {
  typeInputFile: "button";
  buttonStyle?: ViewStyle;
  labelButtonStyle?: TextStyle;
  disabled?: boolean;
  isLoading?: boolean;
  iconSize?: number;
  colorLoading?: string;
  icon?: keyof typeof Ionicons.glyphMap;
  iconColor?: string;
} & InputFileProps