AnimationUpdated in v15

Aurora

An animated aurora background for a hero or a section.

Installation

Import the class, and @use the entry point in your global styles: without it the component renders unstyled.

import { Component } from '@angular/core';
import { WrAurora } from 'ngwr/bits/aurora';

@Component({ imports: [WrAurora] })
export class MyComponent {}
Angular adaptation of an effect by David Haz / reactbits.dev.

Playground

Put it in a positioned box with a height; it fills that box.

<div style="position: relative; min-height: 18rem; overflow: hidden">
  <wr-aurora
    [amplitude]="1"
    [blend]="0.5"
    [speed]="1"
  />
</div>

Customize

Stop A
Stop B
Stop C
Amplitude
1.0
Blend
0.50
Speed
1.0

API

NameDescriptionTypeDefault
colorStopsThree colour stops, from left to right. Unset, they follow the theme.readonly string[] | nullnull
amplitudeWave height multiplier.number1
blendSoftness of the aurora's lower edge, 0..1.number0.5
speedTime multiplier.number1

CSS variables

Set these on the component's selector or a wrapper, not on :root: the defaults are declared on ngwr/bits/aurora's own element.

VariableDefaultDeclared on
--wr-aurora-stop-1light-dark(#6366f1, #5227ff).wr-aurora
--wr-aurora-stop-2light-dark(#10b981, #7cff67).wr-aurora
--wr-aurora-stop-3light-dark(#6366f1, #5227ff).wr-aurora

See also