Progress is used to display the progress status for a task that takes a long time or consists of several steps.
import { Progress } from 'native-base';
const Example = () => {
return <Box w="90%">
<Center mb="10">
<Heading size="md"> Simple Progress Bar</Heading>
</Center>
<Progress value={45} mx="4" />
</Box>;
};
const Example = () => {
return <Box w="90%">
<VStack space="md">
<Heading textAlign="center" mb="10" size="md">
Progress Color Scheme
</Heading>
<VStack mx="4" space="md">
<Progress colorScheme="primary" value={35} />
<Progress colorScheme="secondary" value={45} />
<Progress colorScheme="emerald" value={55} />
<Progress colorScheme="warning" value={65} />
<Progress colorScheme="light" value={75} />
</VStack>
</VStack>
</Box>;
};
const Example = () => {
return <Box w="90%">
<VStack space="md">
<Heading textAlign="center" size="md" mb="10">
Progress Sizes
</Heading>
<VStack mx="4" space="md">
<Progress size="xs" mb={4} value={25} />
<Progress size="sm" mb={4} value={35} />
<Progress size="md" mb={4} value={45} />
<Progress size="lg" mb={4} value={55} />
<Progress size="xl" mb={4} value={65} />
<Progress size="2xl" mb={4} value={75} />
</VStack>
</VStack>
</Box>;
};
const Example = () => {
return <Box w="90%">
<Center mb="10">
<Heading size="md">Flat Progress</Heading>
</Center>
<Progress rounded="0" value={65} mx="4" />
</Box>;
};
const Example = () => {
return <Box w="90%">
<Center mb="10">
<Heading size="md">Custom Track Color</Heading>
</Center>
<Progress colorScheme="primary" bg="cyan.200" mb="4" value={75} mx="4" />
</Box>;
};
Progress implements
,
,
,
,
,
,
,
,
,
,
Defines height of Progress
Type: ResponsiveValue<number | "px" | "full" | "sm" | "6" | "2xs" | "8" | "xs" | "12" | "md" | "16" | "xl" | "24" | "32" | "2" | "0.5" | "4" | "3" | "lg" | "1" | "2xl" | "0" | "container" | "3xs" | "1.5" | ... 29 more ... | (string & {})>
The color scheme of the progress. This should be one of the color keys in the theme (e.g."green", "red").
Pseudo prop to give Prop to filled track
Type: IBoxProps<IProgressProps>
NativeBase ships with a default theme for each component. Check out the default theme of the progress
.
Info:
We can easily extend the progress component theme using extendTheme function as described in the documentation .Adheres to the
progressbar On web, aria-valuenow, aria-valuemin and aria-valuemax is used to ensure the progress percent is visible to screen readers.
On mobile,
is used to ensure it is announced by Talkback and VoiceOver.