LinearProgress
Progress indicators are used to display a loading state or visualize the progress of an operation.
- Useful links:
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> </> );};StrataKit MUI modifications
Section titled āStrataKit MUI modificationsā- The
colorprop does not support"inherit"or"info". - Added an end marker when the
variantprop is set to"determinate"or"buffer". - Restyled using StrataKitās visual language.
- Includes full
forced-colorssupport.
Examples
Section titled āExamplesā- 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> </> );};Determinate
Section titled āDeterminateā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> </> );};