LiveIndicator
Says that what is on screen updates by itself. The light breathes while it is live; paused, it rests. With onToggle it pauses and resumes.
import { LiveIndicator } from '@sypnia/ui/react'
On this page
A stream of logs
New lines appear at the top.
Code
import { useState } from 'react';
import { LiveIndicator } from '@sypnia/ui/react';
// Press it to pause the stream; the light stops breathing and the word changes.
export default function Logs() {
const [live, setLive] = useState(true);
return <div className="sy-row"><LiveIndicator live={live} onToggle={() => setLive(!live)} /><span className="sy-text--muted">{live ? 'New lines appear at the top.' : 'Paused: new lines wait until you press it.'}</span></div>;
} When to use it
Use it when
- Logs, events and charts that stream new data.
Do not use it when
- Pages that update only when reloaded.
For everyone
- As a button it is a toggle with
aria-pressed; the word says Live or Paused. - The breathing stops for people who ask for less motion.
Props
| LiveIndicator | Type | Default |
|---|---|---|
label | ReactNode | |
live | boolean | true |
onToggle | (() => void) |