solid-route-progress

Components

import { Bar, Progress, ProgressProvider, useProgress } from 'solid-route-progress'

<Progress>

import { createProgress, Progress } from 'solid-route-progress'

const progress = createProgress()

<Progress controller={progress} label="Loading page" />
PropDefaultMeaning
controllernearest provided, else a new onethe controller to drive
trickleTo, delay, stopDelay, speedapplied only when the bar creates its own controller
labelLoadingaccessible name
getValueLabel(percent) => string, read as aria-valuetext
busyAttributetruedata-sp-busy on <html> while visible
ariaBusyfalsearia-busy="true" on <html> while visible
class, style, …forwarded; style merges with the custom properties
children<Bar />custom template
RendersWhen
role="progressbar"always
no aria-valuenowwhile trickling (indeterminate)
aria-valuenow + aria-valuetextafter set()

The attributes that mirror the controller (role, the aria-* values, data-state, data-error, the class, and the custom properties) win over props spread onto the element. With several bars the <html> attributes stay until the last one goes idle.

<ProgressProvider>

<ProgressProvider delay={300}>
  <RouteProgress />
  {children}
</ProgressProvider>
PropMeaning
controllershare an existing one
optionsotherwise it creates one from them

Renders nothing.

useProgress()

const progress = useProgress()

progress.track(upload(file))

Reads the nearest controller from <ProgressProvider>, <Progress>, <RouteProgress> or <NavigationProgress>. Throws outside them.

<Bar>

<RouteProgress>
  <Bar class="rounded-r-full" />
  <div class="spinner" aria-hidden="true" />
</RouteProgress>

The default template. It forwards class and other attributes. A spinner and a glow are recipes.

ProgressContext

The shared context, exported for integrations. Prefer useProgress().