Animation

Star Border

Radial comet rays sweeping along the edges of a rounded container. Run them forever or only on hover, mirrored on both edges or as a single ray.

Angular adaptation of an effect by David Haz / reactbits.dev.

Import

import { WrStarBorder } from 'ngwr/star-border';

Playground

Star border
<wr-star-border mode="infinite" rays="mirror" [speed]="6">
  Star border
</wr-star-border>

Customize

Mode
Rays
Speed (s)
6.0 s

As a button

The selector also works as an attribute — handy for buttons and links.

<button wr-star-border mode="hover" rays="single" type="button">
  Hover me
</button>

API

NameDescriptionTypeDefault
colorRay colour. Unset, the theme decides: primary on light, white on dark.string | nullnull
speedSeconds per ray sweep.number6
thicknessVertical ray bleed past the panel (px).number1
modeAlways animating, or only on hover.'infinite' | 'hover''infinite'
raysRays along both edges, or just the bottom.'mirror' | 'single''mirror'

CSS variables

Custom properties ngwr/star-border publishes. Each default below is declared on the component's own selector, so a :root override is shadowed by it — set them on that selector, on a wrapper you scope yourself, or inline on the element. Unlike the BEM class names, these are the supported way to restyle the component.

VariableDefaultDeclared on
--wr-star-border-colorvar(--wr-color-primary).wr-star-border +1 variant override
--wr-star-border-opacity1.wr-star-border +1 variant override
--wr-star-border-radius20px.wr-star-border
--wr-star-border-speed6s.wr-star-border
--wr-star-border-stop16%.wr-star-border +1 variant override