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={8}>
<Heading px={0}>This is a Simple Progress Bar</Heading>
</Center>
<Progress value={45} mx={4} />
</Box>;
};
const Example = () => {
return <Box w="90%">
<VStack space="md">
<Heading textAlign="center" mb={8}>
Progress ColorScheme
</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" mb={8}>
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={8}>
<Heading>Flat Progress</Heading>
</Center>
<Progress rounded="0" size="lg" value={65} mx={4} />
</Box>;
};
const Example = () => {
return <Box w="90%">
<Center mb={8}>
<Heading>Custom Track Color</Heading>
</Center>
<Progress size="lg" colorScheme="primary" bg="secondary.200" mb={4} value={75} mx={4} />
</Box>;
};
Progress implements
,
,
,
,
,
,
,
,
,
,
,
,
Defines height of Progress
The color scheme of the progress. This should be one of the color keys in the theme (e.g."green", "red").
Whether progress is indeterminate
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.