Loader
final class Phui\Components\Loader
A spinner cycling through chars on an interval, between an optional prefix and postfix. The interval starts on mount and is cleared on unmount, so show and hide the loader by mounting it rather than by toggling a prop. Takes no focus and emits nothing.

php
use Phui\Components\Loader;
use Phui\Nodes\Node;
Node::when($this->loading, Loader::mount()->props(postfix: 'Fetching…'));Props
| Prop | Type | Default | Description |
|---|---|---|---|
chars | string[] | ['⠋', '⠙', '⠹', '⠸', '⠼', '⠴', '⠦', '⠧', '⠇', '⠏'] | The frames, cycled in order. |
interval | int | 100 | Milliseconds between frames, read once on mount. |
prefix | string|StyledString | '' | Text before the spinner. |
postfix | string|StyledString | 'Loading...' | Text after the spinner. |
Colours
Phui\Components\Colours\LoaderColours
| Colour | Palette default | Used for |
|---|---|---|
spinner | accent | The spinner frame. |
text | text | The prefix and postfix. |