@wavelo/angular
v0.5.0
Published
An Angular standalone component for CSS loading spinners, skeletons and progress, library-compiled so AOT builds accept it
Maintainers
Readme
@wavelo/angular
Angular component for Wavelo, for Angular 14 and up (standalone components and inject(); the
package is compiled with ngc in partial mode, so an AOT application can import it). Import
LoaderComponent into a standalone component and drive it with inputs.
import { Component } from '@angular/core';
import { LoaderComponent } from '@wavelo/angular';
@Component({
standalone: true,
imports: [LoaderComponent],
template: '<wavelo-loader type="three-dots" label="Loading data" [size]="48" />'
})
export class Screen {}Inputs cover all 28 configuration keys. Two names need care: style binds as
waveloStyle, because Angular already owns [style], and data-* attributes on
the host are read into the configuration. paused, loading, inline and
decorative take a boolean binding, and a bare attribute (paused, loading) is
true the way HTML means it.
Defaults for a whole tree are a provider, not a global:
providers: [{ provide: WAVELO_DEFAULTS, useValue: { color: '#6366f1', size: 32 } }]<wavelo-loader type="ring" [loading]="busy" [count]="3" inline />[loading]="false" renders no markup and injects no stylesheet; the host element
(display: contents) stays empty.
The host element is display: contents, change detection is OnPush, and the
rendered content is cleared on destroy. Only markup is written into the host;
ensureStyles puts the design's stylesheet slice in the document head, so a
server-rendered page should add @wavelo/core/styles.css to the server styles.
Supported peer range: @angular/core >=14.0.0.
Interactive documentation & live preview gallery: https://princegoel0.github.io/wavelo/
See docs/FRAMEWORKS.md and docs/COMPATIBILITY.md.
