UNPKG

1.9 kBTypeScriptView Raw
1import * as React from 'react';
2import { Animated, StyleProp, View, ViewStyle } from 'react-native';
3import type { ThemeProp } from '../types';
4export type Props = React.ComponentPropsWithRef<typeof View> & {
5 /**
6 * Animated value (between 0 and 1). This tells the progress bar to rely on this value to animate it.
7 * Note: It should not be used in parallel with the `progress` prop.
8 */
9 animatedValue?: number;
10 /**
11 * Progress value (between 0 and 1).
12 * Note: It should not be used in parallel with the `animatedValue` prop.
13 */
14 progress?: number;
15 /**
16 * Color of the progress bar. The background color will be calculated based on this but you can change it by passing `backgroundColor` to `style` prop.
17 */
18 color?: string;
19 /**
20 * If the progress bar will show indeterminate progress.
21 */
22 indeterminate?: boolean;
23 /**
24 * Whether to show the ProgressBar (true, the default) or hide it (false).
25 */
26 visible?: boolean;
27 /**
28 * Style of filled part of the ProgresBar.
29 */
30 fillStyle?: Animated.WithAnimatedValue<StyleProp<ViewStyle>>;
31 style?: StyleProp<ViewStyle>;
32 /**
33 * @optional
34 */
35 theme?: ThemeProp;
36 /**
37 * testID to be used on tests.
38 */
39 testID?: string;
40};
41/**
42 * Progress bar is an indicator used to present progress of some activity in the app.
43 *
44 * ## Usage
45 * ```js
46 * import * as React from 'react';
47 * import { ProgressBar, MD3Colors } from 'react-native-paper';
48 *
49 * const MyComponent = () => (
50 * <ProgressBar progress={0.5} color={MD3Colors.error50} />
51 * );
52 *
53 * export default MyComponent;
54 * ```
55 */
56declare const ProgressBar: ({ color, indeterminate, progress, visible, theme: themeOverrides, animatedValue, style, fillStyle, testID, ...rest }: Props) => React.JSX.Element;
57export default ProgressBar;
58//# sourceMappingURL=ProgressBar.d.ts.map
\No newline at end of file