Dictation
The voice-to-text surface (no keyboard on the lens — text is voice or Neural-Band handwriting): a live waveform + the running transcript. You own the recognition and feed transcript.
Platform wishlist — built and waiting on a microphone / system dictation API. The UI ships today; the day Meta exposes the API, it plugs in. See the wishlist →
Installation
npx @glasskit-ui/cli add dictationInstall the SDK (it provides GlassViewport, useDpad and the stylesheet), then copy these files into your project:
npm install @glasskit-ui/react// components/lib/utils.tsexport type ClassValue = string | number | null | undefined | false;/** * Join truthy class names. Dependency-free on purpose: the lens components * style via bespoke semantic classes (no conflicting Tailwind utilities to * de-dupe), so this needs no clsx/tailwind-merge and resolves from anywhere * the registry is vendored. */export function cn(...inputs: ClassValue[]): string { return inputs.filter(Boolean).join(" ");}/** * Accessible name from a free-form `label` prop: the label itself when it's a * plain string, otherwise undefined (a ReactNode can't become an aria-label). */export function stringLabel(label: unknown): string | undefined { return typeof label === "string" ? label : undefined;}// components/glasskit/dictation.tsximport type { ReactNode } from "react";import { cn } from "../lib/utils";/** * <Dictation> — the voice-to-text surface (there is no keyboard on the lens — * text is voice or Neural-Band handwriting). A live waveform + the running * transcript; `listening` animates the bars. Pure display — you own the speech * recognition and feed `transcript`. */export function Dictation({ transcript, listening = true, placeholder = "Speak now…", className,}: { transcript?: ReactNode; listening?: boolean; placeholder?: ReactNode; className?: string;}) { return ( <div className={cn( "gk-dictation", listening && "gk-dictation--listening", className, )} role="status" > <span className="gk-dictation__wave" aria-hidden="true"> <span /> <span /> <span /> <span /> <span /> </span> <span className="gk-dictation__text t-readout"> {transcript != null && transcript !== "" ? ( transcript ) : ( <span className="gk-dictation__placeholder">{placeholder}</span> )} </span> </div> );}Usage
<Dictation transcript={text} listening={isListening} />Props
Prop
Type
ComposeFlow
The working text-entry recipe: a TextField that opens a picker of choices when activated; choosing writes back and returns. The picker rides history, so the back gesture closes it. The seam system dictation would replace.
PermissionPrompt
An explicit access request (sensors, location, camera, mic) — which MRBD apps must ask for before use. A gradient-plate icon, a clear title, the reason, and allow / deny actions.