Code

<!-- plasma-orb.free.js: download it from the Install section below and host it with your site -->
<script src="/plasma-orb.free.js" defer></script>

<plasma-orb
  state="listening"
  level="0.6"
  size="150"
  theme="light"
  label="Voice assistant"
></plasma-orb>

<script>
  const orb = document.querySelector('plasma-orb');
  orb.addEventListener('press', () => {
    orb.state = orb.state === 'idle' ? 'listening' : 'idle';
  });
</script>

In context

Idle
Tap the orb and ask.
Assistant row, Aurora

Press the orb, then say something.

Your microphone, Sunset Pro

Install · Free Web Component

One file, no dependencies. Aurora preset, every other option included. Host it yourself so your visitors never load anything from our servers.

1. Install with one command — or download the file
shadcn CLI · React
npx shadcn@latest add https://www.ui-design.co/r/plasma-orb.json
2. Load it and use the element
HTML
<!-- plasma-orb.free.js: download it from the Install section below and host it with your site -->
<script src="/plasma-orb.free.js" defer></script>

<plasma-orb
  state="idle"
  level="0.6"
  size="120"
  theme="light"
  label="Voice assistant"
></plasma-orb>

<script>
  const orb = document.querySelector('plasma-orb');
  orb.addEventListener('press', () => {
    orb.state = orb.state === 'idle' ? 'listening' : 'idle';
  });
</script>
3. React + TypeScript (optional)

The shadcn command adds a typed React wrapper for you. Using the file directly? Custom elements work in React as-is; for type checking add:

TypeScript
// plasma-orb.d.ts
declare namespace JSX {
  interface IntrinsicElements {
    'plasma-orb': React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement> & {
      state?: 'idle' | 'listening' | 'thinking' | 'speaking';
      level?: number | string;
      size?: number | string;
      theme?: 'light' | 'dark';
      label?: string;
      speed?: number | string;
      toggle?: boolean;
      disabled?: boolean;
    };
  }
}

Pro · React + TypeScript Pro

One payment of $4.99, yours forever. Use it in unlimited personal and commercial projects; no resale.

  • React component with TypeScript types, the shared WebGL core and the GLSL source
  • Sunset, Mint and Mono tints, plus custom three-colour tints
  • Microphone meter: with mic the orb follows the real input level while it listens
  • The vanilla Web Component with every tint, a demo page, README and license

Attributes & props

NameTypeDefaultDescription
state 'idle' | 'listening' | 'thinking' | 'speaking''idle'What the assistant is doing. States blend into each other over about half a second; nothing snaps.
level 0..1built-in patternLoudness: your recogniser’s input level while listening, your speech output while speaking. Leave it out and the orb moves in a quiet pattern of its own.
size number (px)120Diameter of the sphere. The glow reaches about 60% of that further out and takes no layout space.
theme 'light' | 'dark''light'Milky glass with coloured plasma for light pages; dark glass with glowing plasma for dark ones.
label string'Voice assistant'Accessible name of the button.
toggle booleanoffWeb Component only: a press switches state between idle and listening by itself. In React, leave state out for the same behaviour.
speed number1Speed of all motion. 0 freezes it.
disabled booleanoffDims the orb and ignores presses.
press eventClick, Enter or Space on the orb. detail.state is the current state. React: onPress.
tint Pro'aurora' | 'sunset' | 'mint' | 'mono''aurora'Plasma colours. Free build ships Aurora only.
mic ProbooleanoffReads the real microphone level while state is listening. The browser is asked for the microphone only after the first press, never on load; a refusal fires micerror. Audio stays in the page.

The orb is a button: it takes focus, answers Enter and Space, and reports aria-pressed while it listens. It does not run speech recognition; it shows what your assistant is doing, so set state from your own code and pass level if you have one. The filaments are three sheets of noise wound round the centre; thinking winds the same sheets tighter instead of cutting to another picture, which is why the change reads as one motion. Listening sends rings in from the rim and speaking sends light out past the glass, so the two never look alike at a glance. Leave room around it for the glow. Reduced motion freezes the plasma but still shows each state; without WebGL a CSS sphere stands in. All library components on a page share one WebGL context.

More components