data/primitives/docs/components/progress.mdx
<Highlights features={[ "Provides context for assistive technology to read the progress of a task.", ]} />
Install the component from your command line.
npm install @radix-ui/react-progress
Import all parts and piece them together.
import { Progress } from "radix-ui";
export default () => (
<Progress.Root>
<Progress.Indicator />
</Progress.Root>
);
Adheres to the progressbar role requirements.
Contains all of the progress parts.
<PropsTable data={[ { name: "asChild", required: false, type: "boolean", default: "false", description: ( <> Change the default rendered element for the one passed as a child, merging their props and behavior.
Read our <a href="../guides/composition">Composition</a> guide for
more details.
</>
),
},
{
name: "value",
type: "number | null",
description: "The progress value.",
},
{
name: "max",
type: "number",
description: "The maximum progress value.",
},
{
name: "getValueLabel",
type: "(value: number, max: number) => string",
typeSimple: "function",
description:
"A function to get the accessible label text representing the current value in a human-readable format. If not provided, the value label will be read as the numeric value as a percentage of the max value.",
},
]}
/>
<DataAttributesTable data={[ { attribute: "[data-state]", values: ["complete", "indeterminate", "loading"], }, { attribute: "[data-value]", values: "The current value", }, { attribute: "[data-max]", values: "The max value", }, ]} />
Used to show the progress visually. It also makes progress accessible to assistive technologies.
<PropsTable data={[ { name: "asChild", required: false, type: "boolean", default: "false", description: ( <> Change the default rendered element for the one passed as a child, merging their props and behavior.
Read our <a href="../guides/composition">Composition</a> guide for
more details.
</>
),
},
]}
/>
<DataAttributesTable data={[ { attribute: "[data-state]", values: ["complete", "indeterminate", "loading"], }, { attribute: "[data-value]", values: "The current value", }, { attribute: "[data-max]", values: "The max value", }, ]} />