Text Orbit

A clear glass perfume bottle and two small jars casting amber shadows on warm paper
Ember No. 9 · Eau de parfum · 50 ml · Bitter orange · Fig leaf · Smoked amber · Vetiver · Composed in Grasse · Poured by hand ·
About this component

Text Orbit

A round photo encircled by rings of text set on SVG paths, each turning at its own speed and direction, with any ring tilted into a Saturn-like orbit that passes behind and in front of the photo. The whole object leans toward the cursor in 3D, sways on its own when nobody is pointing and floats over a faded reflection. Rings, speed, lean, sway and the reflection are props; the ring type takes its font from the component's own classes. Pauses offscreen and holds still for reduced motion.

Usage

The import and the props worth knowing about, in one place.

import { TextOrbit } from "@/components/beste/component/text-orbit";

<TextOrbit
  className="mx-auto max-w-[520px] font-serif"
  color="var(--primary)"          // any CSS color, tokens included
  image={{ src: "https://images.unsplash.com/photo-1622618991746-fe6004db3a47?w=2000&q=80", alt: "A perfume bottle" }}
  imageScale={1.7}                // zoom of the round photo
  imageFocus="28% 56%"            // where the zoom centers
  rings={[
    { text: "Ember No. 9 · Eau de parfum ·", radius: 1.04, depth: 70 },
    { text: "Bitter orange · Fig leaf · Smoked amber ·", radius: 0.8, speed: 1.7, direction: "counterclockwise" },
    { text: "Composed in Grasse ·", radius: 1.32, speed: 0.7, tilt: 74 }, // tilted orbit
  ]}
  speed={0.6}       // global turning speed
  tilt={0.8}        // lean toward the cursor, 0 to 1
  sway={0.3}        // drift on its own, 0 to 1
  reflection={false}
/>

Props

Read from the component's own type, so this cannot drift from what it accepts.

PropTypeDefaultDescription
ringsTextOrbitRing[]—Rings of text, outer first
image{ src: string; alt: string }—Round photo at the center
imageScalenumber—Zoom of the center photo
imageFocusstring—Point of the photo the zoom centers on, as a CSS position
colorstring—Color of the ring text. Any CSS color, tokens included
speednumber—Global turning speed, 1 is the default pace
tiltnumber—How far the object leans toward the cursor, 0 to 1
swaynumber—How much the object sways on its own, 0 to 1
reflectionboolean—Faded mirror image of the photo below the object
interactiveboolean—Lean toward the cursor; otherwise it only sways
pausedboolean—Stop turning and swaying
classNamestring—

More Text components

View all Text

It only makes sense from here.

A

Breathe