react-native-wheel-picker-expo
Version:
React Native wheel picker like iOS
36 lines (35 loc) • 901 B
TypeScript
import type { FlatListProps } from 'react-native';
export declare type ItemType = {
label: string;
value: any;
};
export declare type RenderItemProps = {
fontSize: number;
label: string;
fontColor: string;
textAlign: 'center' | 'auto' | 'left' | 'right' | 'justify';
};
export interface IViuPickerProps {
items: ItemType[];
onChange: (item: {
index: number;
item: ItemType;
}) => void;
initialSelectedIndex?: number;
height?: number;
width?: any;
flatListProps?: Partial<FlatListProps<ItemType>>;
backgroundColor?: string;
selectedStyle?: {
borderColor?: string;
borderWidth?: number;
};
renderItem?: (props: RenderItemProps) => JSX.Element;
haptics?: boolean;
}
export interface IViuPickerState {
selectedIndex: number;
itemHeight: number;
listHeight: number;
data: ItemType[];
}