Skip to main content

Data Attributes

The easiest way to use the player is to add data-dhivehigpt-player to a standard <audio> element. All configuration is read from data-* attributes on that same element.

<audio
data-dhivehigpt-player
src="https://example.com/article.mp3"
data-accent="true"
data-sticky="true"
></audio>

This works both with the npm package (call init(), or let the UMD build auto-init) and the jsDelivr CDN build.

Reference

AttributeValuesDefaultDescription
data-dhivehigpt-player(presence only)Marks the element for auto-conversion. Required.
data-srcURLOverrides the audio source. If omitted, the element's own src/<source> is used.
data-darkauto | true | falseautoauto follows the visitor's OS/browser dark mode preference live.
data-accenttrue | falsefalseSolid brand-color (#39bbb0) skin. Takes priority over data-dark.
data-shadownone | hairline | soft | lifthairlineControls the bar's box-shadow / elevation.
data-flushtrue | falsefalseEdge-to-edge styling: no border-radius, no border.
data-show-timetrue | falsetrueShow/hide the elapsed / total time label.
data-show-speedtrue | falsetrueShow/hide the playback-speed control.
data-show-volumetrue | falsetrueShow/hide the volume control.
data-speedscomma-separated numbers1,1.25,1.5,2,0.75The list of rates the speed button cycles through, in order.
data-stickytrue | falsefalseStick the bar to the bottom of the viewport while playing. See Sticky player.
data-load-fonttrue | falsefalseOpt-in to loading the "Outfit" font from Google Fonts. See Styling & Theming.

A boolean attribute is also considered true when present with an empty value, e.g. data-accent alone is the same as data-accent="true".

The "Powered by DhivehiGPT" branding link is always shown and cannot be disabled via attributes.