@status-ink/core
v0.1.0
Published
Framework-free primitives for animated status and progress text.
Maintainers
Readme
@status-ink/core
Framework-free primitives for animated status and progress text.
npm install @status-ink/coreControlled status
import { startStatusTransition } from '@status-ink/core';
const transition = startStatusTransition({ status: 'Queued' });
const unsubscribe = transition.subscribe((display) => console.log(display));
transition.update('Running');
transition.update('Complete');
unsubscribe();
transition.stop();
await transition.done;Set initial: 'enter' to animate the first status. Newer updates cancel stale frames instead of
queueing them.
Autonomous fallback
import { startStatusAnimator } from '@status-ink/core';
const animator = startStatusAnimator({
statuses: ['Loading', 'Indexing', 'Rendering'],
holdMs: 2500,
reducedMotion: false,
});
const unsubscribe = animator.subscribe((display) => console.log(display));
unsubscribe();
animator.stop();
await animator.done;Status labels are caller-owned. Built-in effects are available as named imports and through the
ordered effects array. speed changes effect playback; it does not change holdMs.
Open the core example in StackBlitz
Documentation · Live demo · Issues · npm
