# Star

A luminous body drawn from the limb-darkening law rather than a gradient, with granulation, a rotating spot belt, prominence loops anchored on the limb, and a corona.

> For the complete index, see [llms.txt](https://robocn.dev/llms.txt). A Markdown version of any page is available by appending `.md` to its URL or by sending an `Accept: text/markdown` header.

## Install

```bash
bunx --bun shadcn@latest add https://robocn.dev/r/celestial-star.json
```

Registry item: `celestial-star` · [`https://robocn.dev/r/celestial-star.json`](https://robocn.dev/r/celestial-star.json)

## Notes

- The disc is not a radial gradient. Each shell is an annulus carrying `1 − I/I₀` at its own radius, off the law `I/I₀ = 1 − u(1 − μ)`. Stacked discs would composite into a ramp of their own making; a ring of the disc darkened by the law is the law and nothing else.
- The outline variants contour the same numbers instead of filling them, so the falloff reads as a set of level curves rather than disappearing.
- Prominences are anchored on the limb, because that is the only place a loop stands clear of the disc and reads as one. They travel round it as the body turns.
- Solved: the darkening law and the radius it is sampled at, the spot belt on the turning body and its foreshortening, the loop arcs along great circles, and the silhouette. Illustrated: the granulation cell shapes, the loop profile and the corona's falloff.
- No radiative transfer, no spectrum, no magnetic field. Activity is a number, not a solved dynamo, and nothing here is a real star.

## Usage

```tsx
import { CelestialStar } from "@/components/ui/celestial-star"

<CelestialStar kind="giant" behavior="flare" prominences={4} />
<CelestialStar activity={0.8} interactive onActivityChange={setActivity} />
```

## Props

| name | type | default | description |
| --- | --- | --- | --- |
| `view` | `"plan" | "front" | "profile" | "iso"` | `"front"` | Where the camera stands. One body, four projections: straight down, straight on, side elevation, or three-quarter from above. |
| `activity` | `number` | — | Controlled activity, 0 quiet to 1 violent. Supplying it stops the loop. |
| `behavior` | `"rotate" | "flare" | "pulse" | "static"` | `"flare"` | Flare grows a loop over half the cycle and lets it fall back; pulse works the radius as well as the activity; rotate holds the surface steady and turns it. |
| `speed` | `number` | `0.16` | Activity cycles per second. |
| `animate` | `boolean` | `true` | Off parks the machine at phase and stops rendering. A reduced-motion preference does the same. |
| `paused` | `boolean` | `false` | Freeze where it stands. |
| `phase` | `number` | `0` | Seconds of offset, so a row of machines breaks step. |
| `interactive` | `boolean` | `false` | Drag across it to work the activity; arrows 5 percent, shift 15, Home quiet and End violent. |
| `onActivityChange` | `(activity: number) => void` | — | Fires on every drag and key press, in controlled mode too. |
| `kind` | `"dwarf" | "main-sequence" | "giant"` | `"main-sequence"` | Sets the radius and the limb-darkening coefficient: a cooler, more extended atmosphere darkens harder at the edge, and it is visible. |
| `spin` | `number` | — | Controlled rotation about the pole, in degrees. Omit and the clock turns it. |
| `tilt` | `number` | `14` | Degrees the pole leans out of vertical. |
| `shells` | `number` | `8` | Concentric bands the darkening law is sampled into, clamped to 3..20. |
| `granules` | `number` | `90` | Convection cells on the disc, clamped to 0..260. |
| `spots` | `number` | `5` | Cool spots in the latitude belt, clamped to 0..12. They go round the back as the body turns. |
| `prominences` | `number` | `3` | Loops anchored on the limb, clamped to 0..8. They grow with activity. |
| `corona` | `boolean` | `true` | The outer halo. |
| `variant` | `"solid" | "outline" | "blueprint" | "wire"` | `"solid"` | How the machine is painted. Geometry never changes between variants. |
| `size` | `"xs" | "sm" | "md" | "lg" | "xl" | number` | `"md"` | Rendered width in pixels, or a step on the scale. |
| `label` | `string` | — | Optional technical caption under the drawing. |
| `color` | `string` | `var(--robot-shell)` | Body panels — the colour the machine reads as. |
| `accent` | `string` | `var(--robot-accent)` | Status colour: tip light, live tool, readouts. |
| `metal` | `string` | `var(--robot-metal)` | Bare machined parts: collars, bolts, tool bodies. |
| `dark` | `string` | `var(--robot-dark)` | Cast joints, base, shadow side. |
| `palette` | `Partial<RobotPalette>` | — | Override any subset of roles at once, including glow and grid. |

## Source

- `src/components/ui/celestial-star.tsx`
