Skip to content

What is LoaderKit? ​

LoaderKit is a set of loading indicators for Android, iOS, macOS, Windows and the web. Each indicator is a small JSON document, called a spec. A native engine on each platform reads the spec and draws it with the platform's own graphics stack.

You can use it in two ways:

  • Built-in indicators. Pick one of 50 indicators by name, such as BallPulse or LineSpinFadeLoader. Set a color, a size, a speed and, for some indicators, params like count.
  • Custom indicators. Write your own spec: elements placed in a box, a shape, and keyframe tracks that animate them. Every engine draws it, with no new native code. See Custom indicators.

One spec, many engines ​

A spec describes an indicator as data:

  • a layout places elements in a unit box (one element, a row, a grid, a ring, a stack);
  • a shape says what each element draws (circle, rect, ring, triangle, line);
  • tracks say how element properties (scale, opacity, rotation, translation, stroke trim) change over one cycle.
json
{
  "schemaVersion": 1,
  "name": "Blink",
  "duration": 1,
  "layout": { "type": "row", "count": 3, "gap": 0.1 },
  "shape": { "type": "circle" },
  "stagger": { "each": 0.2 },
  "tracks": [{ "property": "opacity", "keyTimes": [0, 0.5, 1], "values": [1, 0.2, 1] }]
}

The built-in indicators are specs too. They ship inside every engine, so you only need their name.

PlatformEnginePackage
AndroidCanvas, with a View and a Jetpack Compose composableio.github.maitrungduc1410:loaderkit-core, loaderkit-compose
iOS, macOSCore Animation, with UIKit, AppKit and SwiftUI viewsLoaderKit (Swift Package Manager, CocoaPods)
WindowsMicrosoft.UI.Composition, with a WinUI 3 controlLoaderKit.WinUI, LoaderKit.Core (NuGet)
Web<canvas>, with React, Vue and Svelte components, a <loader-kit> custom element and a class@loader-kit/web (npm)
React Nativethe Android and iOS enginesreact-native-loader-kit (npm)
Toolingschema, validator, reference evaluator@loader-kit/spec (npm)

Why the motion matches ​

All engines follow one document, the specification. It defines units, layouts, shapes, how tracks are sampled, the easing algorithm, the order of transforms and the playback rules.

A shared conformance suite checks this. The repository generates test vectors from a reference evaluator written in TypeScript: for many points in time, the expected position, size, scale, opacity and rotation of every element. The Android, Apple, Windows and web engines load the same vectors in their unit tests and compare every number. So BallPulse at 0.3 seconds is the same frame on every platform.

Status ​

PartStatus
Built-in indicators, their names and paramsStable
Views, composables, controls and their propertiesStable
Writing your own spec (schema version 1)Experimental

Custom specs are experimental

Until the schema is declared stable, a minor release may change it. Built-in indicators and their params are not affected, because each engine ships the matching built-in specs.

All packages share one version number, and release tags look like 1.0.0 (no v prefix).

Next steps ​

Released under the MIT License.