Skip to content

Voice note

An audio message as a waveform: play, pause, see where you are and drag to seek.

CSS + mian.js JSON Markdown Registry item

In a conversation

0:42

Transcript: “The proofs are in. Page six needs a wider margin, the rest is good to print.”

Installation

Everything ships in one stylesheet and one small script. There is nothing to import per component.

<link rel="stylesheet" href="https://mian.ro/dist/mian.css">
<script src="https://mian.ro/dist/mian.js" defer></script>

Prefer to own the files? /r/voice-note.json is a registry item with this component's CSS and example markup, ready to copy into your project with any tool that reads the open registry-item format.

Class reference

Class / attributeDescription
mn-voiceThe player. Add data-mn-voice and data-duration (seconds); data-src plays a real file.
mn-voice-playThe play / pause button, with two icons: mn-voice-go and mn-voice-pause.
mn-voice-waveThe waveform. Bars are drawn for you; pass real peaks (0 to 1) in data-peaks.
mn-voice-timeElapsed time, or the length when stopped.

Accessibility

  • The waveform is a slider: arrow keys seek, Home and End jump, Space plays.
  • The button’s label switches between Play and Pause.
  • Offer a transcript next to any spoken message.
  • Nothing plays until the person presses play.
Choose a noodle

Minimal

Flat

Pixel

Linear

Thin

Glass

Textured

Bold

Elegant

Rounded

On this page