Mixins / foldkit-mixins-ui

Progress

namespace · packages/mixins-ui/src/progress.ts:1

export * as Progress from './progress.js'

In the guides

Members

Progress.ProgressSection

interface · packages/mixins-ui/src/progress.ts:37

interface ProgressSection {
  readonly label: string
  readonly value: number
  readonly tone?: ProgressTone | undefined
}

One part of a stacked bar.

Progress.ProgressSlots

const · packages/mixins-ui/src/progress.ts:22

const ProgressSlots: Slots.Contract<{ readonly root: Slot.UnnamedSlot<Capability.Capability<"Container", readonly [Capability.Capability<"Interactive", readonly [Capability.Capability<"Base", readonly []>]>]>, readonly Slot.EventName[], readonly Slot.AttributeName[], readonly Slot.RequirementName[], boolean>; readonly label: Slot.UnnamedSlot<Capability.Capability<"Container", readonly [Capability.Capability<"Interactive", readonly [Capability.Capability<"Base", readonly []>]>]>, readonly Slot.EventName[], readonly Slot.AttributeName[], readonly Slot.RequirementName[], boolean>; readonly value: Slot.UnnamedSlot<Capability.Capability<"Container", readonly [Capability.Capability<"Interactive", readonly [Capability.Capability<"Base", readonly []>]>]>, readonly Slot.EventName[], readonly Slot.AttributeName[], readonly Slot.RequirementName[], boolean>; readonly track: Slot.UnnamedSlot<Capability.Capability<"Container", readonly [Capability.Capability<"Interactive", readonly [Capability.Capability<"Base", readonly []>]>]>, readonly Slot.EventName[], readonly Slot.AttributeName[], readonly Slot.RequirementName[], boolean>; readonly buffer: Slot.UnnamedSlot<Capability.Capability<"Container", readonly [Capability.Capability<"Interactive", readonly [Capability.Capability<"Base", readonly []>]>]>, readonly Slot.EventName[], readonly Slot.AttributeName[], readonly Slot.RequirementName[], boolean>; readonly indicator: Slot.UnnamedSlot<Capability.Capability<"Container", readonly [Capability.Capability<"Interact …;

@foldkit/ui's Progress, a progressbar with its value, drawn as a bar or, with the recipe's shape: 'ring', as Circular Progress. A value of none is indeterminate (data-state="indeterminate"): work whose end is not known, which a bar shows sliding and a ring turning. The root carries the share done as --fk-progress, 0 to 1, which a ring draws and a bar needs not, since upstream sizes its indicator.

A value given as sections is one bar stacked of parts, each a section of its own tone; the bar's value is their sum. buffer draws how far the work could go already (a video loaded past the playhead) behind the fill, and segments cuts the track into that many steps, so a count of steps done reads as steps.

Progress.ProgressTone

type · packages/mixins-ui/src/progress.ts:34

type ProgressTone = Tone

The tones a fill takes: the shared vocabulary, as Meter's levels take success, warning and error.

Progress.ProgressView

interface · packages/mixins-ui/src/progress.ts:45

interface ProgressView<Message> {
  readonly id: string
  readonly label: string
  readonly value: Option.Option<number> | ReadonlyArray<ProgressSection>
  readonly min?: number | undefined
  readonly max?: number | undefined
  readonly buffer?: number | undefined
  readonly segments?: number | undefined
  readonly valueText?:
    string | ((value: number, max: number) => string) | undefined
  readonly showValue?: boolean | undefined
  readonly style?: NamedStyle<typeof ProgressSlots> | undefined
  readonly mixins?: MixinList<Message> | undefined
}

Progress.view

function · packages/mixins-ui/src/progress.ts:81

function view<Message>(
  options: ProgressView<Message>,
  h: HtmlBuilder<Message>,
): Html