Skip to content

LinearProgress

Progress indicators are used to display a loading state or visualize the progress of an operation.

import * as React from "react";
import LinearProgress from "@mui/material/LinearProgress";
import Typography from "@mui/material/Typography";
export default () => {
const labelId = React.useId();
return (
<>
<LinearProgress aria-labelledby={labelId} />
<Typography id={labelId}>Analyzing results…</Typography>
</>
);
};
  • The color prop does not support "inherit" or "info".
  • Added an end marker when the variant prop is set to "determinate" or "buffer".
  • Restyled using StrataKit’s visual language.
  • Includes full forced-colors support.
  • Primary: The default. Use when indicating the primary loading state on a page.
  • Secondary: Use when indicating a secondary loading state or when multiple loading states are shown at once.
import * as React from "react";
import LinearProgress from "@mui/material/LinearProgress";
import Typography from "@mui/material/Typography";
export default () => {
const labelId = React.useId();
return (
<>
<LinearProgress color="secondary" aria-labelledby={labelId} />
<Typography id={labelId}>Analyzing results…</Typography>
</>
);
};

Set the variant prop to "determinate" when the completion percentage is known.

import * as React from "react";
import LinearProgress from "@mui/material/LinearProgress";
import Stack from "@mui/material/Stack";
import Typography from "@mui/material/Typography";
export default () => {
const labelId = React.useId();
const progress = 50;
return (
<>
<LinearProgress
variant="determinate"
value={progress}
aria-labelledby={labelId}
/>
<Stack direction="row" sx={{ justifyContent: "space-between" }}>
<Typography id={labelId}>Uploading…</Typography>
<Typography>{progress}%</Typography>
</Stack>
</>
);
};

Set the variant prop to "buffer" when progress and buffered work are tracked separately.

import * as React from "react";
import LinearProgress from "@mui/material/LinearProgress";
import Typography from "@mui/material/Typography";
export default () => {
const labelId = React.useId();
return (
<>
<LinearProgress
variant="buffer"
value={33}
valueBuffer={66}
aria-labelledby={labelId}
/>
<Typography id={labelId}>Buffering results…</Typography>
</>
);
};