Label button

A styled button that fires when its command is heard — “launch” clicks it.

The speech path performs a real click on the underlying button, so a type="submit" button submits its form exactly as a pointer click would. While the mic is open the button can swap its content to a spoken hint via listeningContent.

Bringing your own design system? The bare button is this control with zero styling and zero markup.

Basic button

Loading the React Native kit…

Hold anywhere and say:“launch”

Props

  • default command
  • not set
React Native
Updates as you tick props
import { ListensLabelButton } from "@listenssoft/speechui-react-native";import { View, Text } from "react-native";import { useState } from "react";
function Demo() {  const [count, setCount] = useState(0);  return (    <View style={{ gap: 8, alignItems: "flex-start" }}>      <ListensLabelButton        label="Launch"        command="launch"        onPress={() => setCount((c) => c + 1)}      />      <Text>Launched {count} times</Text>    </View>  );}

A hint while listening

listeningContent replaces the button's content while the mic is open — the button itself tells the user what to say.

Loading the React Native kit…

Hold anywhere and say:“confirm”

React Native
import { ListensLabelButton } from "@listenssoft/speechui-react-native";import { View, Text } from "react-native";import { useState } from "react";
function Demo() {  const [last, setLast] = useState("—");  return (    <View style={{ gap: 8, alignItems: "flex-start" }}>      <ListensLabelButton        label="Confirm order"        command="confirm"        listeningContent='say “confirm”'        onPress={() => setLast(new Date().toLocaleTimeString())}      />      <Text>Last confirmed: {last}</Text>    </View>  );}

What you can say

SayEffect
“launch”Fires the button once (a real click on the underlying element).
“…ready to launch now…”Also fires — matching is contains, not starts-with, unless another control claimed the phrase first.
“launch … (again within ~1s)”Ignored: a per-command cooldown swallows the interim re-deliveries of one utterance. Repeating after a brief pause fires again.

Buttons match anywhere in the phrase but respect claims: if a value control claimed the transcript with a starts-with match (say, a text field named “launch window”), the button stays quiet.

API reference

React Native props for @listenssoft/speechui-react-native.

Props

PropTypeDefaultDescription
listeningContentstringcommandShown instead of the label while the mic is open.
disabledboolean—Disables the button.

Extra props

PropTypeDefaultDescription
label*string—The button text; the spoken command fallback.
commandstringlabelThe spoken command that fires onPress.
onPress() => void—Press handler — fires for taps and speech alike.
styleStyleProp<ViewStyle>—Style override for the button container.
textStyleStyleProp<TextStyle>—Style override for the label text.

Styling hooks

Style props and theme keys

HookTypeDefaultDescription
style / textStyleStyleProp—Direct overrides.
theme.buttonFace / theme.onButton / theme.buttonBordertoken—Default chrome colors from the active ListensTheme.

Behavior notes

  • React Native: Holding directly on a button via the hold-anywhere surface still fires its onPress on release (native can't cancel a child's press); the mic button avoids the issue. See the hold-to-talk guide.

Was this page helpful?