Boot Loader

@sushindustries/ui

A count to a hundred that stalls at ninety until the thing it is covering has actually arrived.

4 min read
View as Markdown

Props

PropTypeDefaultDoes
children?ReactNode-Drawn in the middle, above the counter. A spinning mark, usually.
duration?number1600Roughly how long a full run takes, in milliseconds.
ready?booleantrueTrue once whatever this is waiting for has arrived. The count runs on its own and stalls near the end until this flips. That is the whole design: a progress bar that finishes before the thing it is measuring is a progress bar that lies, and one that only moves when real work reports in sits at zero for two seconds and looks broken.
onDone?() => void-Called once the counter has reached a hundred and faded.
label?string"Loading"Read out instead of the number, which is meaningless spoken.

Notes

Anything the types cannot say: which combinations are meaningless, which prop is ignored when another is set, and what it does when handed something it cannot render.