AnimationUpdated in v15

Circular Text

Text laid out on a spinning circle.

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 { WrCircularText } from 'ngwr/bits/circular-text';

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

Playground

HELLO * NGWR *
<wr-circular-text
  text="HELLO * NGWR * "
  [spinDuration]="20"
  onHover="speedUp"
/>

Customize

Spin Duration (s)
20 s
On Hover
Text

API

NameDescriptionTypeDefault
textrequiredText to lay out around the circle.string—
spinDurationSeconds per full revolution at rest.number20
onHoverHover behaviour. null disables hover reactivity.'speedUp' | 'slowDown' | 'pause' | 'goBonkers' | null'speedUp'

CSS variables

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

VariableDefaultDeclared on
--wr-circular-text-char-line-heightvar(--wr-leading-none).wr-circular-text
--wr-circular-text-font-weightvar(--wr-font-weight-bold).wr-circular-text
--wr-circular-text-radiuscalc(var(--wr-circular-text-size) / 2).wr-circular-text
--wr-circular-text-size12rem.wr-circular-text

See also