Sinua
Catalog

Signal

Ten light volumes for a voice, a value or a status, from a swelling veil to a crystal, a dune, a scan and a broadcast.

The signal is a set of light volumes: hundreds of points of light in 3D, lit by depth and drawn as crisp discs that add up on a dark background. Each one shows a value, a voice or a status, and each one keeps moving on its own with no input at all.

See every signal pattern live

When to use which pattern

PatternpatternWhen to use it
VeilveilA sheet of light that swells with a voice or any 0 to 1 value, and keeps moving while something is worked on.
CrystalcrystalA crystal filled from below: a voice's bands, or one value like a battery, a quota or a goal.
DuneduneA dune whose done part glows: a long task's progress, or a recorded voice message.
CometcometWaiting with no end in sight: a stream of points orbiting a faint core.
FlowflowSomething is being made: a front of light sweeping across a sheet of points.
CohesioncohesionHow well something holds, like a connection or a match: a sphere that loses points as quality falls.
ScanscanLooking for something: a beam sweeping a disc, with found points flashing.
ConstellationconstellationA task in stages: one cloud per step, done ones tight and bright.
RipplerippleSomething happened, look here: shells of warm light spreading from a core.
BroadcastbroadcastSending, speaking out: fans of light opening left and right.

Every volume reads its inputs in the same order: its own value (level or progress, from your app or a binding), else a bound voice's level, which counts only while the agent listens or speaks, else its own noise field. Nothing is tied to the voice, so any of them works as a status visual. Every volume also takes churn (0 to 1, default 0): restless work, such as thinking, that keeps it moving and brightens it with no level. Their pace is the view's speed. Veil, crystal, broadcast, comet, flow, scan, dune and constellation are drawn from one fixed camera (veil, crystal and broadcast no longer sway, and constellation does not spin); only cohesion and ripple still turn slowly.

On a small view a volume draws fewer points (about 150 at 48 px, 420 at 128 px, 1,000 from 256 px). Reduced motion holds each one still in its pose, and low power draws plain dots instead of soft glows.

Veil

A sheet of light: layers of points curl one behind the other. With a voice it swells with the level; with level it shows any 0 to 1 value; with churn it keeps moving while something is worked on. Use it for a voice or any live level, like an assistant that speaks and listens.

Crystal

A crystal filled from below: each column lights up to its value and unlit cells stay as dust. With a voice, the bands fill the columns. With level it is one value, such as a battery, a quota or a goal. Use it for a level or quota you want to read exactly, like a battery, a goal or a meter.

Dune

A dune: a series is its profile, the done part glows, and a plane of light marks the position. envelope is the series (up to 64 values from 0 to 1) and progress the position; for a long task, progress alone is enough. Without progress the plane drifts across on its own. Use it for progress through something long or a recording, like a download or a voice message.

Comet

A stream of 260 points orbiting a faint core sphere: the head leads, the tail breathes with the noise and the hue runs from head to tail. level sets the brightness and the tail length; churn lengthens and brightens the tail. Use it for a wait with no end in sight, like a tool call that is still running.

Flow

About 800 points in a sheet. A front with a sharp leading edge sweeps across at a noisy pace, lifts the sheet into a crest and leaves a fading trail, and a fainter second front follows 1.6 s behind. level sets how strongly the fronts light the slab; churn strengthens the second front and adds a shimmer. Use it for something being made, like text or an image that is generating.

Cohesion

A sphere of about 450 points that loses its place as quality falls. Each point lets go at its own threshold, drifts apart and warms to amber, and gathers again when quality rises. quality runs 0 to 1 and defaults to 1 (whole); churn adds a tremor and a brighter sphere, for trying again. Use it for how well something holds, like a connection or a sync.

Scan

A tilted disc of about 900 points and a beam sweeping it. The beam lights what it passes; found points flash white and burn down over about 2.2 s. blips is how many are found (a whole number from 0 to 12, default 7); churn lengthens the trail, for still searching. Use it for a search that finds things; each found point is a hit.

Constellation

steps clouds of about 110 points fill one after another around a circle, starting at the top and going clockwise. A done step is tight and bright, the current one gathers out of dust, and the ones to come are very faint small clouds on a faint path of the circle. progress runs over all steps, an equal share each; steps is a whole number from 2 to 8 (default 5). With no progress, the first step is done and the next one gathers and loosens on its own. churn makes the clouds shimmer. Use it for a job in stages, like an agent working through its steps.

Ripple

Crinkled shells of warm amber light, up to about 300 points each, spreading from a warm core and fading as they grow. A shell leaves about every 1.6 s on a slightly uneven beat. churn fades in a second train of shells. Use it for something that just happened, like a notification or an event.

Broadcast

Two fans of light opening left and right of a small white core, a front after a front. Louder fronts burn brighter and a second train fades in; quiet, they are few and faint. churn brings in the second train with no level, for waiting on a reply. Use it for sending or speaking out, like a live or outgoing stream.

Keys of one pattern

quality (cohesion), steps and progress (constellation) and blips (scan) are plain numbers from your app. quality and progress can also be bound to an input, so a file maps your data onto them.

signal-keys
signal-keys-react.tsx
import { SinuaSignal } from "@sinua/web/components";

// The signal patterns' own keys: each is one number from your app.
export function Keys({ quality, blips }: { quality: number; blips: number }) {
  return (
    <>
      {/* How whole the sphere is, 0 to 1: as it falls, points let go and warm to amber. */}
      <SinuaSignal pattern="cohesion" quality={quality} style={{ width: 96, height: 96 }} />
      {/* Stages (2 to 8) and how far along: the clouds light up in turn. */}
      <SinuaSignal pattern="constellation" steps={4} progress={0.5} style={{ width: 96, height: 96 }} />
      {/* Points found (0 to 12): each flashes as the beam reaches it. */}
      <SinuaSignal pattern="scan" blips={blips} style={{ width: 96, height: 96 }} />
    </>
  );
}

A voice message

SinuaVoiceMessage draws dune in a wide box, the way a chat app shows a voice message: the clip's loudness is the profile, the played part glows and a plane of light marks the position. It comes with drag-to-seek and a slider for screen readers (not on React Native yet). Sinua decodes no audio: your app passes up to 64 loudness values as envelope, and progress from 0 to 1.

Up to an aspect of 2.2 the dune is the turned volume above. From 2.2 to 3 it eases into a strip: the camera turns to a side view, the dune fills the box and stands taller so the profile reads at 40 px high. With progress given, the plane holds still; without it, it drifts slowly across.

voice-message-react.tsx
import { useState } from "react";
import { SinuaVoiceMessage } from "@sinua/web/react";

// A voice message in a chat bubble: the waveform, the played part in full ink, and a
// drag or tap anywhere on it to seek. Your app plays the audio; Sinua draws it.
export function VoiceMessage({ peaks, audio }: { peaks: number[]; audio: HTMLAudioElement }) {
  const [progress, setProgress] = useState(0);
  audio.ontimeupdate = () => setProgress(audio.currentTime / audio.duration);
  return (
    <SinuaVoiceMessage
      envelope={peaks} // up to 64 loudness values, 0..1
      progress={progress}
      onSeek={(p) => (audio.currentTime = p * audio.duration)}
      style={{ width: 220, height: 40 }}
    />
  );
}

// Sinua decodes no audio. One way to get the peaks in a browser:
export async function peaksOf(url: string, count = 48): Promise<number[]> {
  const data = await (await fetch(url)).arrayBuffer();
  const samples = (await new AudioContext().decodeAudioData(data)).getChannelData(0);
  const step = Math.floor(samples.length / count);
  const peaks = Array.from({ length: count }, (_, i) => {
    let max = 0;
    for (let j = i * step; j < (i + 1) * step; j++) max = Math.max(max, Math.abs(samples[j]));
    return max;
  });
  const top = Math.max(...peaks) || 1;
  return peaks.map((p) => p / top);
}

Props

Every prop, per pattern. Values are your app's data; everything else is style. Defaults can differ per size (20 · 32 · 64).

The signal component is SinuaSignal. Pick a look with pattern; each pattern reads the props below. Sizes are engine sizes (20, 32, 64): defaults can differ per size.

PatternModeSpeedValues (app data)
Veil (veil)veil1×level
Crystal (crystal)crystal1×level
Dune (dune)dune1×progress, envelope
Comet (comet)comet1×level
Flow (flow)flow1×level
Cohesion (cohesion)cohesion1×level, quality
Scan (scan)scan1×blips, level
Constellation (constellation)constellation1×level, progress
Ripple (ripple)ripple1×level
Broadcast (broadcast)broadcast1×level

Veil

pattern: "veil" · mode veil · speed 1× · sizes 20, 32, 64

PropCategoryTypeRangeDefaultDescription
inkAppearancenumber0–1 fraction1How present the whole visual is: 1 draws it as the pattern defines it, lower fades everything including its halos. A voice assistant rests below 1 when idle and comes to full ink when it listens.
layerCountAppearanceinteger3–129Sheets of light, front to back.
churnMotionnumber0–1 fraction0Restless work, 0 to 1: the sheet keeps moving with no level (thinking, processing).
levelInputsnumber0–1 fraction0How high the sheet swells, 0 to 1: any value (a bound input) or, when left out, a bound voice's level; with neither the sheet breathes on its own.

Crystal

pattern: "crystal" · mode crystal · speed 1× · sizes 20, 32, 64

PropCategoryTypeRangeDefaultDescription
columnCountAppearanceinteger4–2416Columns of cells, one per band or value.
inkAppearancenumber0–1 fraction1How present the whole visual is: 1 draws it as the pattern defines it, lower fades everything including its halos. A voice assistant rests below 1 when idle and comes to full ink when it listens.
churnMotionnumber0–1 fraction0Restless work, 0 to 1: cells light and fade on their own.
levelInputsnumber0–1 fraction0One value for the whole crystal, 0 to 1 (a battery, a quota, a goal). Left out, a bound voice's bands fill the columns; with neither it idles low.

Dune

pattern: "dune" · mode dune · speed 1× · sizes 20, 32, 64

PropCategoryTypeRangeDefaultDescription
inkAppearancenumber0–1 fraction1How present the whole visual is: 1 draws it as the pattern defines it, lower fades everything including its halos. A voice assistant rests below 1 when idle and comes to full ink when it listens.
churnMotionnumber0–1 fraction0Restless work, 0 to 1: the unlit sand shimmers.
progressInputsnumber0–1 fraction0How much is done, 0 to 1: a clip's position or a long task's progress. The done part glows. Left out, the plane drifts across on its own.
Advanced props (1)
PropCategoryTypeRangeDefaultDescription
envelopeInputsnumber[] (1–64)0–1 fraction[]The dune's profile, 0 to 1 per value (a clip's loudness or any series; up to 64). Without it a fixed dune is drawn.

Comet

pattern: "comet" · mode comet · speed 1× · sizes 20, 32, 64

PropCategoryTypeRangeDefaultDescription
inkAppearancenumber0–1 fraction1How present the whole visual is: 1 draws it as the pattern defines it, lower fades everything including its halos. A voice assistant rests below 1 when idle and comes to full ink when it listens.
churnMotionnumber0–1 fraction0Restless work, 0 to 1: a longer, brighter tail (thinking, processing). Its pace is the view's speed.
levelInputsnumber0–1 fraction0How brightly and how long the stream burns, 0 to 1: any value (a bound input) or, when left out, a bound voice's level; with neither it glows low and keeps circling.

Flow

pattern: "flow" · mode flow · speed 1× · sizes 20, 32, 64

PropCategoryTypeRangeDefaultDescription
inkAppearancenumber0–1 fraction1How present the whole visual is: 1 draws it as the pattern defines it, lower fades everything including its halos. A voice assistant rests below 1 when idle and comes to full ink when it listens.
churnMotionnumber0–1 fraction0Restless work, 0 to 1: a stronger second front and a shimmer across the sheet (thinking, processing). Its pace is the view's speed.
levelInputsnumber0–1 fraction0How strongly the fronts light the sheet, 0 to 1: any value (a bound input) or, when left out, a bound voice's level; with neither it glows low and keeps sweeping.

Cohesion

pattern: "cohesion" · mode cohesion · speed 1× · sizes 20, 32, 64

PropCategoryTypeRangeDefaultDescription
inkAppearancenumber0–1 fraction1How present the whole visual is: 1 draws it as the pattern defines it, lower fades everything including its halos. A voice assistant rests below 1 when idle and comes to full ink when it listens.
churnMotionnumber0–1 fraction0Restless work, 0 to 1: a tremor through every point and a brighter sphere (trying again).
levelInputsnumber0–1 fraction0How brightly the sphere burns, 0 to 1: any value (a bound input) or, when left out, a bound voice's level; with neither it glows low.
qualityInputsnumber0–1 fraction1How whole the sphere is, 0 to 1: as it falls the points let go one by one and warm to amber; 1 (the default) is whole.

Scan

pattern: "scan" · mode scan · speed 1× · sizes 20, 32, 64

PropCategoryTypeRangeDefaultDescription
inkAppearancenumber0–1 fraction1How present the whole visual is: 1 draws it as the pattern defines it, lower fades everything including its halos. A voice assistant rests below 1 when idle and comes to full ink when it listens.
churnMotionnumber0–1 fraction0Restless work, 0 to 1: a longer trail behind the beam (still searching). Its pace is the view's speed.
blipsInputsinteger0–127How many points the scan has found, 0 to 12: each flashes white as the beam reaches it and burns down.
levelInputsnumber0–1 fraction0How brightly the beam burns, 0 to 1: any value (a bound input) or, when left out, a bound voice's level; with neither it glows low.

Constellation

pattern: "constellation" · mode constellation · speed 1× · sizes 20, 32, 64

PropCategoryTypeRangeDefaultDescription
inkAppearancenumber0–1 fraction1How present the whole visual is: 1 draws it as the pattern defines it, lower fades everything including its halos. A voice assistant rests below 1 when idle and comes to full ink when it listens.
stepsAppearanceinteger2–85How many clouds of light, 2 to 8.
churnMotionnumber0–1 fraction0Restless work, 0 to 1: the clouds shimmer (thinking, processing).
levelInputsnumber0–1 fraction0How brightly the clouds burn, 0 to 1: any value (a bound input) or, when left out, a bound voice's level; with neither they burn at a quiet default.
progressInputsnumber0–1 fraction0How far through all the steps, 0 to 1: each step takes an equal share. Left out, the first step is done and the next one gathers and loosens on its own.

Ripple

pattern: "ripple" · mode ripple · speed 1× · sizes 20, 32, 64

PropCategoryTypeRangeDefaultDescription
inkAppearancenumber0–1 fraction1How present the whole visual is: 1 draws it as the pattern defines it, lower fades everything including its halos. A voice assistant rests below 1 when idle and comes to full ink when it listens.
churnMotionnumber0–1 fraction0Restless work, 0 to 1: a second train of shells fades in between the first (thinking, processing).
levelInputsnumber0–1 fraction0How brightly the shells burn, 0 to 1: any value (a bound input) or, when left out, a bound voice's level; with neither they burn at a quiet default.

Broadcast

pattern: "broadcast" · mode broadcast · speed 1× · sizes 20, 32, 64

PropCategoryTypeRangeDefaultDescription
inkAppearancenumber0–1 fraction1How present the whole visual is: 1 draws it as the pattern defines it, lower fades everything including its halos. A voice assistant rests below 1 when idle and comes to full ink when it listens.
churnMotionnumber0–1 fraction0Restless work, 0 to 1: a second train of fronts fades in with no level (waiting on a reply).
levelInputsnumber0–1 fraction0How strongly the fronts burn and how often they leave, 0 to 1: any value (a bound input) or, when left out, a bound voice's level; with neither a slow swell stands in.

On this page