Mixins / foldkit-mixins-ui

Spinner

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

export * as Spinner from './spinner.js'

In the guides

Members

Spinner.SpinnerSlots

const · packages/mixins-ui/src/spinner.ts:10

const SpinnerSlots: Slots.Contract<{
  readonly wheel: Slot.UnnamedSlot<
    Capability.Capability<
      'Container',
      readonly [
        Capability.Capability<
          'Interactive',
          readonly [Capability.Capability<'Base', readonly []>]
        >,
      ]
    >,
    readonly Slot.EventName[],
    readonly Slot.AttributeName[],
    readonly Slot.RequirementName[],
    boolean
  >
}>

A loading spinner publishes one slot; it owns no state, messages, or bundles. It says work is ongoing where a bar would mislead about progress; pair it with Skeleton for content taking shape.

Spinner.SpinnerView

interface · packages/mixins-ui/src/spinner.ts:18

interface SpinnerView<Message = never> {
  readonly label?: string | undefined
  readonly style?: NamedStyle<typeof SpinnerSlots> | undefined
  readonly mixins?: MixinList<Message> | undefined
}

A spinner in one call: what is loading, a style for its slot, and mixins beside the style. No upstream component stands behind it.

Spinner.view

function · packages/mixins-ui/src/spinner.ts:27

function view<Message = never>(
  options: SpinnerView<Message>,
  h: HtmlBuilder<Message>,
): Html