DocumentPicker

img

A basic DocumentPicker component that should render nicely on any platform. Supports a good level of customization.

You can customization Image component with the Props

Usage#

Basics#

const App: FC = () => {
const [singleFile, setSingleFile] = useState < any > [];
return (
<DocumentPicker
fileType={'allFiles'}
type={'Single'}
buttonLabel={<Text>documents</Text>}
files={async (res: any) => {
setSingleFile(res);
}}
data={
<ScrollView>
{singleFile.length > 0 &&
singleFile.map((item, key) => (
<View key={key}>
<Text>
File Name: {item.name ? item.name : ''}
{'\n'}
Type: {item.type ? item.type : ''}
{'\n'}
File Size: {item.size ? item.size : ''}
</Text>
<Text>
URI: {item.uri ? item.uri : ''}
{'\n'}
</Text>
</View>
))}
</ScrollView>
}
/>
);
};

Reference#

Props#

here all the list of Props you can use for StarRating Component and it Inherits all ViewProps, from React Native

type#

props gives you single or multiple filetype, type string default value is single

files#

props gives you what will be picked from phone it will be return the file data, type function

width#

props gives you width of button type number default value is 100

height#

props gives you height of button type number default value is 30

bgColor#

props gives you bgColor type string default value is Blue

borderRadius#

props gives you borderRadius type number default value is 5px

base64#

props type is boolean. If you give true the uri can be converted to base64 format from your picker file data and default type is false

fileType#

this props gives you different pickerFormat like'allFiles' | 'images' | 'plainText' | 'audio' | 'pdf' type string and default value is allFiles

filesize#

prop type is number.If you give the number size of file will be less than or equal to picker file data.Incase picker file greater than filesize it will return large file.

buttonLabel#

props render the list of jsx elements

data#

props render the list of jsx elements with your picker file data