---
title: "Progress · UI SDK — StyleX Blocks"
description: "Determinate progress bars with outline and subtle tracks in five sizes."
url: "https://stylexblocks.com/components/ui-sdk/progress/"
agent:
  instructions: "Use this search API to find relevant components and blocks across this site with keywords or natural-language queries, instead of crawling individual pages. Results are returned in Markdown."
  endpoint: "https://stylexblocks.com/.well-known/search?q={query}"
  method: "GET"
  documentation: "https://developers.cloudflare.com/ai-search/how-to/search-for-agents/"
---

# Progress

Determinate progress bars with outline and subtle tracks in five sizes.

- Behavior engine: UI SDK
- Also available for: [Ark UI](https://stylexblocks.com/components/ark-ui/progress.md), [Base UI](https://stylexblocks.com/components/base-ui/progress.md)
- Category: Feedback
- Variants: subtle, outline
- Sizes: xs, sm, md, lg, xl
- Used in blocks: [Analytics Dashboard](https://stylexblocks.com/block/ui-sdk/analytics-dashboard.md), [Collapsible Table](https://stylexblocks.com/block/ui-sdk/collapsible-table.md), [Comparison Table](https://stylexblocks.com/block/ui-sdk/comparison-table.md), [Course Detail](https://stylexblocks.com/block/ui-sdk/course-detail.md), [Data Dashboard](https://stylexblocks.com/block/ui-sdk/data-dashboard.md), [Documentation Technical](https://stylexblocks.com/block/ui-sdk/documentation-technical.md), [Executive Dashboard](https://stylexblocks.com/block/ui-sdk/executive-dashboard.md), [File Explorer](https://stylexblocks.com/block/ui-sdk/file-explorer.md), [Inline Wizard](https://stylexblocks.com/block/ui-sdk/form-wizard-inline.md), [Vertical Wizard](https://stylexblocks.com/block/ui-sdk/form-wizard-vertical.md), [Order Detail](https://stylexblocks.com/block/ui-sdk/order-detail.md), [Portfolio Dashboard](https://stylexblocks.com/block/ui-sdk/portfolio-dashboard.md), [Product Detail](https://stylexblocks.com/block/ui-sdk/product-detail.md), [Project Status Dashboard](https://stylexblocks.com/block/ui-sdk/project-status-dashboard.md), [Settings Dialog](https://stylexblocks.com/block/ui-sdk/settings-dialog.md), [Settings Panels](https://stylexblocks.com/block/ui-sdk/settings-panels.md), [Shell Nav](https://stylexblocks.com/block/ui-sdk/shell-nav.md), [Side Nav Shell](https://stylexblocks.com/block/ui-sdk/shell-side-nav.md), [Top Nav Shell](https://stylexblocks.com/block/ui-sdk/shell-top-nav.md), [Theme Showcase](https://stylexblocks.com/block/ui-sdk/theme-showcase.md), [Tree Table](https://stylexblocks.com/block/ui-sdk/tree-table.md), [Work Item Detail](https://stylexblocks.com/block/ui-sdk/work-item-detail.md)
- HTML page: https://stylexblocks.com/components/ui-sdk/progress/

## Install

Configure the project once (sets the behavior engine and import aliases):

```sh
npx stylexblocks init --style ui-sdk
```

Then add the item as source you own:

```sh
npx stylexblocks add progress
```

Equivalent: `npx shadcn add @stylexblocks/progress`. Registry item JSON: https://stylexblocks.com/r/ui-sdk/progress.json

## Usage

```tsx
import { Progress } from "#components/ui/ui-sdk/progress.tsx";
import { indigoPalette } from "@stylexblocks/ui/themes/palettes.ts";

export function Example() {
  return (
    // UI SDK's Progress parts wearing the recipe styles — they carry value
    // state and aria; variant/size/shape resolve once on Root and
    // Track/Range (UI SDK's Indicator) inherit them via context
    <Progress.Root value={64} variant="subtle" size="md" shape="full" palette={indigoPalette}>
      <Progress.Label>Upload</Progress.Label>
      <Progress.Track>
        <Progress.Range striped />
      </Progress.Track>
      <Progress.ValueText />
    </Progress.Root>
  );
}
```

## Source

`components/ui/ui-sdk/progress.tsx`

```tsx
import {
  Progress as UiSdkProgress,
  ProgressIndicator as UiSdkProgressIndicator,
  ProgressLabel as UiSdkProgressLabel,
  ProgressTrack as UiSdkProgressTrack,
  ProgressValue as UiSdkProgressValue,
} from "@ui-sdk/react/progress";
import { createSlotRecipeContext } from "#lib/ui-sdk/create-slot-recipe-context.tsx";
import {
  defineSlotRecipe,
  resolveSlotStyles,
  type SlotRecipeVariants,
  type WithStyleOverrides,
} from "#lib/recipe-props.ts";
import * as stylex from "@stylexjs/stylex";
import { colorPalette } from '@stylexblocks/ui/color-palette.stylex.ts'
import { durations } from '@stylexblocks/ui/tokens/durations.stylex.ts'
import { fontSizes } from '@stylexblocks/ui/tokens/font-sizes.stylex.ts'
import { fontWeights } from '@stylexblocks/ui/tokens/font-weights.stylex.ts'
import { lineHeights } from '@stylexblocks/ui/tokens/line-heights.stylex.ts'
import { radii } from '@stylexblocks/ui/tokens/radii.stylex.ts'
import { semanticColors } from '@stylexblocks/ui/semantic-tokens/colors.stylex.ts'
import { semanticRadii } from '@stylexblocks/ui/semantic-tokens/radii.stylex.ts'
import { semanticShadows } from '@stylexblocks/ui/semantic-tokens/shadows.stylex.ts'
import { sizes } from '@stylexblocks/ui/tokens/sizes.stylex.ts'

const progressRoot = stylex.create({
  base: {
    fontSize: fontSizes.sm,
    lineHeight: lineHeights.sm,
    position: 'relative',
  },
})

const progressTrack = stylex.create({
  base: {
    overflow: 'hidden',
    position: 'relative',
  },
})

const progressTrackSizes = stylex.create({
  xs: {
    height: sizes._1_5,
  },
  sm: {
    height: sizes._2,
  },
  md: {
    height: sizes._2_5,
  },
  lg: {
    height: sizes._3,
  },
  xl: {
    height: sizes._4,
  },
})

const progressTrackVariants = stylex.create({
  outline: {
    boxShadow: semanticShadows.inset,
    backgroundColor: semanticColors.bgSubtle,
  },
  subtle: {
    backgroundColor: colorPalette.muted,
  },
})

const progressTrackShapes = stylex.create({
  rounded: {
    borderRadius: semanticRadii.control,
  },
  full: {
    borderRadius: radii.full,
  },
})

const progressRange = stylex.create({
  base: {
    display: 'flex',
    alignItems: 'center',
    justifyContent: 'center',
    transitionProperty: 'width, height',
    transitionDuration: durations.slow,
    height: '100%',
    backgroundColor: 'var(--track-color)',
  },
})

const progressRangeVariants = stylex.create({
  outline: {
    backgroundColor: colorPalette.solid,
  },
  subtle: {
    backgroundColor: `color-mix(in oklch, ${colorPalette.solid} 72%, transparent)`,
  },
})

const progressRangeStripeds = stylex.create({
  true: {
    backgroundImage:
      'linear-gradient(45deg, var(--stripe-color) 25%, transparent 25%, transparent 50%, var(--stripe-color) 50%, var(--stripe-color) 75%, transparent 75%, transparent)',
    backgroundSize: 'var(--stripe-size) var(--stripe-size)',
    '--stripe-size': '1rem',
    '--stripe-color': 'rgba(255, 255, 255, 0.3)',
  },
})

const progressRangeAnimateds = stylex.create({
  true: {
    '--animate-from': 'var(--stripe-size)',
    animationName: 'bg-position',
    animationDuration: '1s',
    animationTimingFunction: 'linear',
    animationIterationCount: 'infinite',
  },
})

const progressLabel = stylex.create({
  base: {
    display: 'inline-flex',
    fontWeight: fontWeights.medium,
  },
})

const progressValueText = stylex.create({
  base: {
    fontSize: fontSizes.xs,
    lineHeight: 1,
    fontWeight: fontWeights.medium,
  },
})

export type ProgressVariant = keyof typeof progressTrackVariants

export type ProgressShape = keyof typeof progressTrackShapes

export type ProgressStriped = keyof typeof progressRangeStripeds

export type ProgressAnimated = keyof typeof progressRangeAnimateds

export type ProgressSize = keyof typeof progressTrackSizes

const progressSlotRecipe = defineSlotRecipe({
  slots: {
    root: { styles: progressRoot },
    track: {
      styles: progressTrack,
      sizes: progressTrackSizes,
      variants: progressTrackVariants,
      shapes: progressTrackShapes,
    },
    range: {
      styles: progressRange,
      variants: progressRangeVariants,
    },
    label: { styles: progressLabel },
    valueText: { styles: progressValueText },
  },
  defaultVariants: { variant: "outline", size: "md", shape: "rounded" },
});

const { withProvider, withContext } = createSlotRecipeContext(progressSlotRecipe);

type ProgressVariants = SlotRecipeVariants<typeof progressSlotRecipe>;

/**
 * Progress — UI SDK's Progress parts wearing the recipe styles.
 * `<Progress.Root variant size shape>` resolves the recipe once and shares
 * it with Track/Range through context; the parts carry value state and
 * aria semantics (`value`, `min`, `max`). The Range (UI SDK's Indicator
 * part) takes boolean `striped`/`animated` props layering the recipe's
 * stripe maps, and every part still composes via `render`.
 */
export type ProgressRootProps = WithStyleOverrides<
  React.ComponentProps<typeof UiSdkProgress>
> &
  Partial<ProgressVariants>;

const ProgressRoot = withProvider(UiSdkProgress, "root", "ProgressRoot");

function Root(props: ProgressRootProps) {
  return <ProgressRoot {...(props as React.ComponentProps<typeof ProgressRoot>)} />;
}
Root.displayName = "ProgressRoot";

export type ProgressRangeProps = WithStyleOverrides<
  React.ComponentProps<typeof UiSdkProgressIndicator>
> & {
  /** Diagonal stripe pattern from the recipe. */
  striped?: boolean;
  /** Animates the stripes (pair with `striped`). */
  animated?: boolean;
};

const StyledRange = withContext(
  UiSdkProgressIndicator,
  (v) => resolveSlotStyles(progressSlotRecipe.slots.range, v),
  "ProgressRange",
);

function Range({ striped, animated, style, ...rest }: ProgressRangeProps) {
  return (
    <StyledRange
      {...rest}
      style={[
        striped && progressRangeStripeds.true,
        animated && progressRangeAnimateds.true,
        style,
      ]}
    />
  );
}
Range.displayName = "ProgressRange";

export const Progress = {
  Root,
  Label: withContext(UiSdkProgressLabel, "label", "ProgressLabel"),
  Track: withContext(UiSdkProgressTrack, "track", "ProgressTrack"),
  Range,
  ValueText: withContext(UiSdkProgressValue, "valueText", "ProgressValueText"),
};
```
