Progress Small Circular Progress
src / Demo.tsx
123456789101112131415161718192021import React, { ReactElement, useEffect } from "react";
import { useTimeout, useToggle } from "@react-md/utils";
import { Button } from "@react-md/button";
import { CircularProgress } from "@react-md/progress";
export default function Demo(): ReactElement | null {
const [loading, enable, disable] = useToggle(false);
const [start] = useTimeout(disable, 10000);
useEffect(() => {
if (loading) {
start();
}
}, [loading, start]);
return (
<>
<Button onClick={enable}>Show</Button>
{loading && <CircularProgress id="small-circular-progress" small />}
</>
);
}