Orbit
Server ComponentIcons or avatars revolving around a nucleus on pure-CSS rings.
Import
import { Orbit, OrbitRing, OrbitItem } from "@cronus-ui/ui";
npx cronus-ui add orbit
Examples
.cronus
The same component declared in Cronus. Emitted at build time from the audit fixtures — the kernel renders it as HTML with no React.
default.cronus
app "audit-fixtures" {
port 5176
}
style {
preset aurora
theme dark
}
component OrbitDefault layout:inline style:orbit {
aria-label:"Orbit"
label "Orbit"
text "A"
text "B"
text "C"
}
page "/audit/orbit/default" type:custom {
use OrbitDefault
}
API Reference
Generated from the component's exported types.
OrbitProps
Extends HTMLAttributes<HTMLDivElement>
| Prop | Type | Default | Description |
|---|---|---|---|
className | string | — | Additional class names merged onto the root. |
children | ReactNode | — | Contents of the component. |
id | string | — | DOM id of the root element. |
OrbitRingProps
Extends HTMLAttributes<HTMLDivElement>
| Prop | Type | Default | Description |
|---|---|---|---|
radius* | number | — | Radius of the ring in pixels — the distance from the nucleus' centre to the centre of each orbiting item. The ring renders as a `2 × radius` circle absolutely centred on the stage. |
duration | number | DEFAULT_DURATION | Seconds for one full revolution. Larger is calmer; concentric rings look best with distinct durations so their items never sync up. Defaults to `24`. |
reverse | boolean | false | Revolve counter-clockwise instead of clockwise. Defaults to `false`. |
startAngle | number | 0 | Angle of the first item's slot in degrees, measured clockwise from 12 o'clock. Remaining items stay evenly distributed after the offset. Use it to de-align concentric rings' starting positions. Defaults to `0`. |
guide | boolean | true | Draw the faint circular guide (`border-border/40`). Defaults to `true`. |
className | string | — | Additional class names merged onto the root. |
children | ReactNode | — | Contents of the component. |
id | string | — | DOM id of the root element. |
OrbitItemProps
Extends HTMLAttributes<HTMLDivElement>
| Prop | Type | Default | Description |
|---|---|---|---|
className | string | — | Additional class names merged onto the root. |
children | ReactNode | — | Contents of the component. |
id | string | — | DOM id of the root element. |