Back to Mantine

Progress

apps/mantine.dev/src/pages/core/progress.mdx

9.1.11.3 KB
Original Source

import { ProgressDemos } from '@docs/demos'; import { Layout } from '@/layout'; import { MDX_DATA } from '@/mdx';

export default Layout(MDX_DATA.Progress);

Usage

<Demo data={ProgressDemos.usage} />

Compound components

<Demo data={ProgressDemos.compound} />

Vertical orientation

<Demo data={ProgressDemos.vertical} />

With tooltips

<Demo data={ProgressDemos.tooltips} />

Section width transition

Set transitionDuration to a number of milliseconds to enable width transition:

<Demo data={ProgressDemos.transition} />

Example: progress with segments

<Demo data={ProgressDemos.segments} /> <StylesApiSelectors component="Progress" /> <Demo data={ProgressDemos.stylesApi} />

Accessibility

  • Progress section has the role="progressbar" attribute
  • Progress section has the aria-valuenow attribute with the current value
  • aria-valuemin and aria-valuemax attributes are always set to 0 and 100 as the component does not support other values

Set the aria-label attribute to label the progress:

tsx
import { Progress } from '@mantine/core';

function Demo() {
  return <Progress aria-label="Uploading progress" value={10} />;
}

function DemoCompound() {
  return (
    <Progress.Root>
      <Progress.Section aria-label="Uploading progress" value={10} />
    </Progress.Root>
  );
}