Back to library

Text to speech

Read a specified passage aloud using the browser’s speech engine.

You can listen to this passage using your browser’s speech engine.

Checking speech support…

Recommended API

Property or elementTypeExample initial valueDescription
SpeechSynthesisUtteranceBrowser speech APIEnglish example passagePass the passage and its language to the browser speech engine.
Read and StopButtonsRead becomes available when supportedStart or cancel reading the sample passage.

States

StateTriggerResult
readingActivate Read aloud on a supported browser.Reading starts and Stop becomes available.
idleStop or reach the end of the passage.The status updates and Read is available again.

CSS variables

VariableTypeDefaultDescription
--q-textcolor #28302aMain text and foreground color.
--q-mutedcolor #70776fColor for secondary text.
--q-font-sizelength 13pxBase size for the component text.
--q-accentcolor #344e41Accent for active controls, indicators and focus.
--q-bordercolor #dce0d8Color for outlines and dividers.
--q-radiuslength 10pxBase corner radius.
--q-gaplength calc(var(--q-space) * 2)Space between items, based on the spacing unit.
--q-control-pxlength calc(var(--q-space) * 4)Horizontal padding for controls.
--q-control-pylength calc(var(--q-space) * 2.5)Vertical padding for controls.
--q-spacelength 4pxBase unit for gaps and padding.