Progress
nativeui/progressFreeComponent
A progress component for React Native applications.
Live preview
live · rendered by the registry
Rendered by nativeui on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://nativeui.ribbi.ch/r/progress.jsonSource
1import * as React from "react";2import { View, Animated, Easing } from "react-native";3import { cn } from "@/lib/utils";45interface ProgressProps {6 value?: number;7 max?: number;8 className?: string;9 indicatorClassName?: string;10}1112const Progress = React.forwardRef<View, ProgressProps>(13 ({ value = 0, max = 100, className, indicatorClassName, ...props }, ref) => {14 const animatedValue = React.useRef(new Animated.Value(0)).current;1516 React.useEffect(() => {17 Animated.timing(animatedValue, {18 toValue: value,19 duration: 500,20 easing: Easing.bezier(0.4, 0.0, 0.2, 1),21 useNativeDriver: false,22 }).start();23 }, [value, animatedValue]);2425 const width = animatedValue.interpolate({26 inputRange: [0, max],27 outputRange: ["0%", "100%"],28 extrapolate: "clamp",29 });3031 return (32 <View33 ref={ref}34 className={cn(35 "relative h-3 w-full overflow-hidden rounded-full bg-primary/20",36 className37 )}38 {...props}39 >40 <Animated.View41 className={cn(42 "absolute left-0 top-0 h-full bg-primary",43 indicatorClassName44 )}45 style={{ width }}46 />47 </View>48 );49 }50);5152Progress.displayName = "Progress";5354export { Progress };
What it pulls in
npm packages
Files it writes
More from nativeui
All 29 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Accordionaccordion | nativeui | Components | Free | 2 deps | |
| Alertalert | nativeui | Components | Free | 2 deps | |
| Alert Dialogalert-dialog | nativeui | Components | Free | 1 dep | |
| Avataravatar | nativeui | Components | Free | 1 dep | |
| Badgebadge | nativeui | Components | Free | 2 deps | |
| Breadcrumbbreadcrumb | nativeui | Components | Free | 2 deps | |
| Buttonbutton | nativeui | Components | Free | 2 deps | |
| Calendarcalendar | nativeui | Components | Free | 4 deps |
