Text

Display text that swaps when listening.

Renders listeningContent instead of its normal content while the mic is open.

Under a provider

Hold inside the frame: the text swaps while you hold and swaps back on release.

Loading the React kit…

Props

React
Updates as you tick props
import { ListensText } from "@listenssoft/speechui-react";
function Demo() {  return (    <p>      <ListensText listeningContent='“Listening is active”'>        Hold anywhere on the page to talk.      </ListensText>    </p>  );}

API reference

React props for @listenssoft/speechui-react.

Props

PropTypeDefaultDescription
listeningContentReactNode—Content shown instead of children while the mic is open.

Extra props

PropTypeDefaultDescription
childrenReactNode—Content shown when not listening.
…HTMLAttributes<HTMLSpanElement>span props—Everything else (className, style, id, aria-*) is forwarded to the rendered <span>.

Styling hooks

CSS hooks

HookTypeDefaultDescription
.listens-textclass—The rendered span. While listening it carries data-listening and shows the accent color by default.
--listens-accenttoken—The listening color the swap uses. Override to retheme.

Behavior notes

  • All frameworks: Text is the one control that does not register with the page contract (there is nothing to command), so it injects the default stylesheet itself rather than via registration.
  • React: listeningContent accepts any ReactNode; the Angular input is a string.

Was this page helpful?