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 playgroundAbout
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
npm i @ashutoshswamy/smouiUsage
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
More effects components
- AuroraSlow drifting colour behind your content. Only transforms animate; it stands still with reduced motion.
- BorderBeamA light that runs around the edge of whatever it wraps, at an even pace along straight sides and rounded corners alike. Reduced motion parks it still.
- CompareSliderBefore/after reveal. Drag the divider; the top layer follows on a spring. It sweeps once to show it moves.
- ConfettiButton that throws flat confetti on press. Pieces fly out, tumble, then fall and fade.
- DotFieldA grid of dots that swells and shrinks away from the pointer, then springs home. One canvas, asleep when nothing moves.
- GlassLensA magnifier that drifts after the cursor like a drop of water. Press to zoom further.