Orbling

Shows an orb with a face that tells the user what an AI assistant is doing, such as thinking, reading, typing, working, or asking a question. Each mood plays its own CSS animation, the palette derives from one theme color, and the OrblingStatus part pairs a small orb with a shimmering label for chat status lines. Every part holds still when the user prefers reduced motion, and the component needs no WebGL or extra packages.

zzz
+page.svelte
<script lang="ts">
	import { Orbling } from "#lib/components/ui/orbling/index.js";
</script>

<Orbling mood="thinking" size="lg" />

Installation

Run the command below to add the component to src/lib/components/ui/orbling.

pnx remote0 add https://plainsv.com/r/orbling.json

Moods

Set mood to idle, thinking, reading, typing, working, asking, waiting, watching, surprised, sleepy, or error. The default is idle, a new mood starts its animation from the beginning, and watching turns the eyes toward the pointer.

idle
thinking
reading
typing
working
asking
waiting
watching
surprised
sleepy
error
  • Use thinking while the assistant works out an answer
  • Use reading while it reads pages, files, or results
  • Use typing while it writes the reply
  • Use working while a tool or task runs
  • Use asking when it asks the user a question, then waiting until the user answers
  • Use watching for an empty state that waits on the user
  • Use error when something fails
+page.svelte
<Orbling mood="working" />

Variants

Set variant to default, secondary, or destructive. The default variant is blue from --chart-1, secondary is grey from --muted-foreground, and destructive is red from --destructive.

+page.svelte
<Orbling variant="secondary" />

Sizes

Set size to xs, sm, md, or lg, which sets a diameter of 16, 32, 72, or 120 pixels. The default is md.

+page.svelte
<Orbling size="sm" />

Shapes

Set shape to circle, squircle, hexagon, diamond, heart, star, or blob. The default is circle, and every part that has an outline, such as the glow, the tint, and the typing dots, follows the shape.

circle
squircle
hexagon
diamond
heart
star
blob
custom
+page.svelte
<Orbling shape="heart" />

Pass any SVG path to shape for a custom outline. Draw the path in a 100 by 100 box, since the orb stretches it to fill its diameter, and keep the middle open for the eyes.

+page.svelte
<Orbling shape="M20 6 L80 6 Q94 6 94 20 L94 66 Q94 80 80 80 L44 80 L24 96 L26 80 L20 80 Q6 80 6 66 L6 20 Q6 6 20 6 Z" />

Set --orbling-shape to any CSS mask image, such as an SVG file or a gradient, for outlines a path cannot draw. The working mood morphs any shape into its turning gear and back.

+page.svelte
<Orbling style="--orbling-shape: url(/shapes/cloud.svg)" />

Colors

Set --orbling-color to change the base color. The orb keeps the lightness of its original palette and takes the hue and chroma of the color you set, so any theme token works.

+page.svelte
<Orbling style="--orbling-color: var(--chart-3)" />

Status

Use OrblingStatus for a status line in a chat. It shows a 16 pixel orb beside the mood label, such as "Thinking…", uses role="status" so screen readers announce changes, and takes mood, variant, shape, size, and a label that replaces the default text.

Thinking… Reading… Typing… Working… Asking…
+page.svelte
<script lang="ts">
	import { OrblingStatus } from "#lib/components/ui/orbling/index.js";
</script>

<OrblingStatus mood="reading" label="Reading the docs…" />

Accessibility

The orb is decorative by default, so screen readers skip it. Set label when the orb carries meaning, which gives it role="img" and an accessible name.

+page.svelte
<Orbling mood="thinking" label="Assistant is thinking" />

API

The Orbling and OrblingStatus props extend the native span attributes, and extra attributes pass through to the root. The package also exports MOODS, which maps each mood to its label, and MOOD_NAMES, which lists every mood, plus SHAPES, which maps each preset to its SVG path, and SHAPE_NAMES, which lists every shape.

index.ts
interface Props extends CompProps<"span"> {
	/** What the assistant is doing; defaults to `idle` */
	mood?: Mood;
	/** Orb colors: `default` is blue from `--chart-1`, `secondary` is grey, and `destructive` is red; `--orbling-color` overrides the base color */
	variant?: "default" | "secondary" | "destructive";
	/** Orb outline: a preset such as `squircle` or `heart`, or a custom SVG path in a 100 by 100 box; defaults to `circle`, and `--orbling-shape` overrides it with any mask image */
	shape?: OrblingShape | (string & {});
	/** Orb diameter on the shared scale; defaults to `md` */
	size?: UiSize;
	/** Accessible name; without it screen readers skip the orb */
	label?: string;
}

interface StatusProps extends CompProps<"span"> {
	/** What the assistant is doing; defaults to `idle` */
	mood?: Mood;
	/** Orb colors, as on `Orbling` */
	variant?: "default" | "secondary" | "destructive";
	/** Orb outline, as on `Orbling` */
	shape?: OrblingShape | (string & {});
	/** Label text and gap on the shared scale; defaults to `sm` */
	size?: UiSize;
	/** Status text; defaults to the mood label, such as "Thinking…" */
	label?: string;
}

Credits

Orbling is a Svelte port of orbling by Timotej Kochjar, released under the MIT License. The original React component and its source live at github.com/kochjar/orbling. This port keeps its moods and motion, replaces the WebGL heat shader with the original's CSS glow, and derives the palette from theme tokens.