Orbit

Items circling a centre on concentric rings, upright as they go. Point at it and everything slows so you can read it. Effects.

Open playground

About

Orbit is a React component in the Effects category of smoui. It is typed, ships no stylesheet, follows your theme through CSS variables, and honors prefers-reduced-motion. Import it with import { Orbit } from "@ashutoshswamy/smoui" and set rings, center, itemSize.

Install

Terminal
npm i @ashutoshswamy/smoui

Usage

TSX
import { Orbit, Avatar } from "@ashutoshswamy/smoui";

<Orbit
  center={<Logo />}
  rings={[
    { radius: 70, duration: 22, items: [<Avatar name="Ada" />, <Avatar name="Lin" />] },
    { radius: 130, duration: 38, reverse: true, items: icons },
  ]}
/>

Props 3

rings

Each ring: its items, radius in px, seconds per turn, direction.

{ items; radius; duration?; reverse? }[]
center

What sits in the middle.

ReactNode
itemSize

Box size of each orbiting item. Default 44.

number