Skip to content
العربية
Feedback

Progress, ProgressRing

Progress bar and ring with their values for screen readers.

import { Progress, ProgressRing } from "@percentsa/ui";

Examples

30%
Code
export function ProgressExample() {
  const t = useT();
  const [value, setValue] = useState(30);
  useEffect(() => {
    const id = setInterval(() => setValue((v) => (v >= 100 ? 0 : v + 10)), 800);
    return () => clearInterval(id);
  }, []);
  return (
    <Inline gap={8} className="w-full max-w-md">
      <Progress value={value} aria-label={t("Upload", "الرفع")} className="flex-1" />
      <ProgressRing value={value} aria-label={t("Upload", "الرفع")} showValue />
    </Inline>
  );
}