glasscn
ShowcaseDocsComponentsStudioThemingNative
5Get started
Guides
IntroductionInstallationThemingFonts & typeStudioReact Native
Surfaces
AuroraBackdropGlassLiquid glassCardTheme scopeBackground extensionScroll areaAccordionCollapsibleAlertItemEmpty
Typography
TypographyProse
Controls
ButtonBadgeInputTextareaLabelSwitchCheckboxSegmented controlTabsGlass groupGlass clusterGlass morphSliderProgressKbdSeparatorAvatarGlass preferencesComboboxCalendarDate pickerSpinnerSkeletonSelectRadio groupFieldInput groupButton groupToggleToggle groupStepper
Overlays
DialogAlert dialogSheetAction sheetPopoverTooltipDropdown menuToasterCommandDrawerContext menuConfirmation popover
Navigation
DockToolbarScroll edgeNavigation barSidebarSearch fieldGrouped list
Data
Activity ringsProgress ringSparklineStatKPIWidgetRange chartBar listGaugeTrackerCategory barHeatmapChartArea chartBar chartLine chartDonut chartTableData table
Chat
ChatChat markdownChat parts
Blocks
More Apple glass examplesLiquid Glass examplesDashboardAnalyticsSettingsSign inChat
glasscn — a shadcn registry. Copy it, own it, change it.DocsThemingregistry.json
Controlsradix-ui

Progress

A capsule bar filling from the second chart colour into the accent.

Installation

pnpm dlx shadcn@latest add https://glasscn.app/r/progress.json

React Native (iOS, Android and web through react-native-web) — same parts and props:

pnpm dlx shadcn@latest add https://glasscn.app/r/native-progress.json

Or with the namespace set up: shadcn add @glasscn-app/progress

Source

components/glass/progress.tsx
"use client"

import * as React from "react"
import { cn } from "@/lib/glass-cn"
import { Progress as ProgressPrimitive } from "radix-ui"

/**
 * A capsule bar whose fill runs from the second chart colour into the accent. `value` runs from 0 to `max` (100).
 * The fill is sized by `width`, so it grows from the inline start and runs right-to-left under `dir="rtl"`.
 */
function Progress({ className, value, max = 100, ...props }: React.ComponentProps<typeof ProgressPrimitive.Root>) {
  const pct = max > 0 ? Math.min(100, Math.max(0, ((value || 0) / max) * 100)) : 0
  return (
    <ProgressPrimitive.Root
      data-slot="progress"
      value={value}
      max={max}
      className={cn("relative h-2.5 w-full overflow-hidden rounded-button bg-fill", className)}
      {...props}
    >
      <ProgressPrimitive.Indicator
        data-slot="progress-indicator"
        data-glass-motion
        className="h-full rounded-button bg-linear-to-r from-chart-2 to-primary transition-[width] duration-[calc(var(--glass-duration)*3)] ease-out motion-reduce:transition-none rtl:bg-linear-to-l"
        style={{ width: `${pct}%` }}
      />
    </ProgressPrimitive.Root>
  )
}

export { Progress }
SliderKbd
Year 2 of 522%