Lab

useStatusLine

A line of status an editor says things on, what it is doing and what an action had nothing to do on, which clears itself after a few seconds.

pnpm dlx shadcn@latest add @audio-ui/use-status-line
import { useStatusLine } from "@/hooks/use-status-line";
Fileshooks/use-status-line.ts
Depends onNothing
npmNothing
Used byblock-audio-editor
ExportKindWhat it is
useStatusLinefunctionA line of status an editor says things on: what it is doing ("Rendering…") and what an action had nothing to do on.

Usage

import { useStatusLine } from "@/hooks/use-status-line";

const [status, say] = useStatusLine(); // clears after 5 s; pass milliseconds to change it

say("Rendering…");
say("No silence at the start or the end");

<span aria-live="polite">{status}</span>;

Saying something else replaces the message and starts its time again; saying an empty string clears it. useClipEdits takes say as its notify.

Built by Ouest Labs, the source code is available on GitHub.
RSS