City of Ghent Style Guide

Text to speech button

Use text to speech to let users listen to the content of web pages.

When to use this component

When the website has a text so speech ability, use the text to speech button to let the user trigger the text to speech function to read the content on the current web page out loud.

The text to speech button should be enabled on:

  • Desktop resolutions (not on tablet nor on mobile)
  • Detail pages only

When not to use this component

When the website has a text to speech ability, the text to speech button should not be enabled on:

  • Mobile and tablet resolutions
  • Overview pages and filter pages

If the website requires the text to speech button anyway, this can of course be overruled and the text to speech button can be placed on any page and on any resolution where it is required.

How it works

The text to speech button triggers the text to speech ability of the website to read the content of the current web page out loud so that users can listen to the page.

Depending on the text to speech solution that is used in the website, the behavior can be different.

The text to speech button should always be placed just below the Heading 1.

More about text to speech solutions

Text to speech solutions read the content of web pages out loud so that a website user can listen to the web page. There are used to make content available to a larger population of internet such as those with literacy difficulties, learning disabilities, reduced vision, language learners, the growing elderly population, and anyone else looking for a simpler way to access digital content on the go. Text to speech solutions are specifically very useful for users for longer texts.

<button class="readspeaker-button">
  <i class="icon-readspeaker" aria-hidden="true"></i><span>{{ 'Listen' }}</span>
<button class="readspeaker-button">
    <i class="icon-readspeaker" aria-hidden="true"></i><span>Listen</span>
/* No context defined. */
  • Content:
    .readspeaker-button {
      @include theme('color', 'color-none', 'readspeaker-color');
      @include theme('background-color', 'color-zero', 'readspeaker-background-color');
      @include medium-text;
      @include bold-text;
      display: block;
      min-height: 1.8rem;
      margin-bottom: 1.5rem;
      padding: 0 .75rem 0 .4rem;
      transition: background-color .2s ease-in-out, color .2s ease-in-out;
      border: 0;
      cursor: pointer;
      &:hover {
        @include theme('background-color', 'color-primary--lighten-5', 'button-primary-hover-background');
      i {
        @include theme('color', 'color-none', 'button-primary-color');
        display: inline-block;
        margin-right: .3rem;
        padding: .1em .3em;
        font-size: .9rem;
        vertical-align: middle;
      span {
        vertical-align: middle;
  • URL: /components/raw/text-to-speech-button/_text-to-speech-button.scss
  • Filesystem Path: components/31-molecules/text-to-speech-button/_text-to-speech-button.scss
  • Size: 792 Bytes